diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2015-03-15 01:08:23 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2015-03-15 01:08:23 +0000 |
| commit | ad80af8f191503fe33deecf8efc57ff2878aa3d1 (patch) | |
| tree | 6c2f4a03c9f707b602fb36fd801d22c1e817dcb7 /clang/lib/Sema/SemaChecking.cpp | |
| parent | 86ecb1bdaf2e7570ac33cc9e00d76375cf00d5d2 (diff) | |
| download | bcm5719-llvm-ad80af8f191503fe33deecf8efc57ff2878aa3d1.tar.gz bcm5719-llvm-ad80af8f191503fe33deecf8efc57ff2878aa3d1.zip | |
-Wempty-body: fix false negative triggered by macros
When if statement condition ended in a macro:
if (ptr == NULL);
the check used to consider the definition location of NULL, instead of the
current line.
Patch by Manasij Mukherjee.
llvm-svn: 232295
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index c4ff8b4ef39..5eafa503486 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -8625,7 +8625,7 @@ bool ShouldDiagnoseEmptyStmtBody(const SourceManager &SourceMgr, // Get line numbers of statement and body. bool StmtLineInvalid; - unsigned StmtLine = SourceMgr.getSpellingLineNumber(StmtLoc, + unsigned StmtLine = SourceMgr.getPresumedLineNumber(StmtLoc, &StmtLineInvalid); if (StmtLineInvalid) return false; |

