-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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user