[PATCH] D40185: Loosen -Wempty-body warning.

2017-11-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D40185#928845, @rnk wrote: > Why does passing the rparen location for the if condition fix the warning for > IF_ELSE? I assumed that would refer to the else clause semicolon. Using spelling locations fixes the `else` case, but breaks s

[PATCH] D40185: Loosen -Wempty-body warning.

2017-11-17 Thread Reid Kleckner via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318556: Loosen -Wempty-body warning (authored by rnk). Changed prior to commit: https://reviews.llvm.org/D40185?vs=123406&id=123410#toc Repository: rL LLVM https://reviews.llvm.org/D40185 Files: c

[PATCH] D40185: Loosen -Wempty-body warning.

2017-11-17 Thread Reid Kleckner via Phabricator via cfe-commits
rnk updated this revision to Diff 123406. rnk added a comment. - minor tweak https://reviews.llvm.org/D40185 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseStmt.cpp clang/lib/Sema/SemaChecking.cpp clang/lib/Sema/SemaStmt.cpp clang/test/SemaCXX/warn-empty-body.cpp Index:

[PATCH] D40185: Loosen -Wempty-body warning.

2017-11-17 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. I'll go ahead and land this as requested to unblock things. Thanks for the patch, sorry for the trouble! Comment at: lib/Sema/SemaChecking.cpp:11818 bool StmtLineInvalid; - un

[PATCH] D40185: Loosen -Wempty-body warning.

2017-11-17 Thread Reid Kleckner via Phabricator via cfe-commits
rnk requested changes to this revision. rnk added a comment. This revision now requires changes to proceed. Why does passing the rparen location for the if condition fix the warning for IF_ELSE? I assumed that would refer to the else clause semicolon. https://reviews.llvm.org/D40185

[PATCH] D40185: Loosen -Wempty-body warning.

2017-11-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. Do not show it when `if` or `else` come from macros. E.g., #define USED(A) if (A); else #define SOME_IF(A) if (A) void test() { // No warnings are shown in those cases now. USED(0); SOME_IF(0); } https://reviews.llvm.org/D40185 Files: