-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Bugzilla Link | 35114 |
Version | trunk |
OS | Windows NT |
CC | @hfinkel |
Extended Description
If you compile the following code:
while(true) {}
You get the not especially helpful error message:
<source>:1:1: error: expected unqualified-id
while(true) {}
^
1 error generated.
This came up for me in the context of calling a macro that wrapped a few statements in a do { ... } while(false);
construct, and I spend a fair amount of time looking for a missing semicolon somewhere before I finally found the problem. I would have preferred to get a message along the lines of "while loops not allowed outside of functions" or something else that directly says the problem from the user's perspective.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute