summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-empty-body.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make Preprocessor::Lex non-recursive.Eli Friedman2013-09-191-0/+5
| | | | | | | | | | | | | | | Before this patch, Lex() would recurse whenever the current lexer changed (e.g. upon entry into a macro). This patch turns the recursion into a loop: the various lex routines now don't return a token when the current lexer changes, and at the top level Preprocessor::Lex() now loops until it finds a token. Normally, the recursion wouldn't end up being very deep, but the recursion depth can explode in edge cases like a bunch of consecutive macros which expand to nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this patch). <rdar://problem/14569770> llvm-svn: 190980
* Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)Dmitri Gribenko2012-02-141-0/+271
* if, switch, range-based for: warn if semicolon is on the same line. * for, while: warn if semicolon is on the same line and either next statement is compound statement or next statement has more indentation. Replacing the semicolon with {} or moving the semicolon to the next line will always silence the warning. Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp. llvm-svn: 150515
OpenPOWER on IntegriCloud