New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on semicolons immediately following "else" #34667
Comments
Thanks, should be fixed by r318456. |
This was reverted. |
@llvm/issue-subscribers-clang-frontend Author: None (llvmbot)
| | |
| --- | --- |
| Bugzilla Link | [35319](https://llvm.org/bz35319) |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @dwblaikie,@DougGregor,@rnk,@Weverything |
| Fixed by commit(s) | r318456 |
Extended Descriptionclang version 6.0.0 (trunk 317263) This code:
Gives:
This is good! And it also works for "else if" cases. But I just did the same bug and put a semicolon after a bare else:
And there is no warning. This was pretty tricky to find and it seems like the same rule for "if" semicolons should just also be applied to "else". |
confirming that this is still the case in post 17 trunk(5a56f00) code
no warning given for clang |
Commit that attempted to fix this: adefb76 Commit that revert it says it was reverted it: 59ad150 says:
So someone can likely pick up the original fix and needs to add tests for macros to make sure this does not break likely existing code. |
Also see 9541975 for an example for when the original fix that was reverted failed on. |
Extended Description
clang version 6.0.0 (trunk 317263)
This code:
Gives:
This is good! And it also works for
else if
cases. But I just did the same bug and put a semicolon after a bare else:And there is no warning. This was pretty tricky to find and it seems like the same rule for
if
semicolons should just also be applied toelse
.The text was updated successfully, but these errors were encountered: