diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-19 20:54:25 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-19 20:54:25 +0000 |
commit | a25b6a4b43e8b9611f7506e5fe1b448833b10a46 (patch) | |
tree | 1c8c6e68f978b9b156704e77c31beb8bf573b845 /lib/AST/Stmt.cpp | |
parent | b95cfe4bb01f18a112bcb7eea3b82bc8d6dfe20b (diff) |
Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:
if (condition)
CALL(0); // empty macro but don't warn for empty body.
Fixes rdar://8436021.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r-- | lib/AST/Stmt.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index acd77beaca..85e640701b 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -470,8 +470,10 @@ CXXTryStmt::CXXTryStmt(SourceLocation tryLoc, Stmt *tryBlock, } IfStmt::IfStmt(ASTContext &C, SourceLocation IL, VarDecl *var, Expr *cond, - Stmt *then, SourceLocation EL, Stmt *elsev) - : Stmt(IfStmtClass), IfLoc(IL), ElseLoc(EL) + Stmt *then, SourceLocation EL, Stmt *elsev, + bool macroExpandedInThenStmt) + : Stmt(IfStmtClass), IfLoc(IL), ElseLoc(EL), + MacroExpandedInThenStmt(macroExpandedInThenStmt) { setConditionVariable(C, var); SubExprs[COND] = reinterpret_cast<Stmt*>(cond); |