aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-11-17 21:33:28 +0000
committerReid Kleckner <rnk@google.com>2017-11-17 21:33:28 +0000
commitc0a81071d3d89c4e07f0ef39f5bb96eb9e6df76b (patch)
tree4f333696109dc564b84c0a320134b0642cd9d283 /clang/lib/Sema/SemaChecking.cpp
parent188efda585f1da5ab91eedfe75a292bf6b6fd803 (diff)
downloadllvm-c0a81071d3d89c4e07f0ef39f5bb96eb9e6df76b.zip
llvm-c0a81071d3d89c4e07f0ef39f5bb96eb9e6df76b.tar.gz
llvm-c0a81071d3d89c4e07f0ef39f5bb96eb9e6df76b.tar.bz2
Loosen -Wempty-body warning
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); } Patch by Ilya Biryukov! Differential Revision: https://reviews.llvm.org/D40185 llvm-svn: 318556
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index e662a5c..8a85830b 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -11821,7 +11821,7 @@ static bool ShouldDiagnoseEmptyStmtBody(const SourceManager &SourceMgr,
// Get line numbers of statement and body.
bool StmtLineInvalid;
- unsigned StmtLine = SourceMgr.getPresumedLineNumber(StmtLoc,
+ unsigned StmtLine = SourceMgr.getSpellingLineNumber(StmtLoc,
&StmtLineInvalid);
if (StmtLineInvalid)
return false;