aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-10-23 23:19:32 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-10-23 23:19:32 +0000
commitc7db84d0146a6f22b19949fb0128e2148aa92467 (patch)
tree9d33b6e3660b2720a4d246b01bc9c77ac56443a7 /lib/AST/Expr.cpp
parentf27762b1beced898e47aeae1bcb557addd8a148d (diff)
Don't emit -Wunused-value warnings from macro expansions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 3c8cbb56a0..68bce4b6f6 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -2026,6 +2026,10 @@ bool Expr::isUnusedResultAWarning(const Expr *&WarnE, SourceLocation &Loc,
}
case CXXFunctionalCastExprClass:
case CStyleCastExprClass: {
+ // Ignore casts within macro expansions.
+ if (getExprLoc().isMacroID())
+ return false;
+
// Ignore an explicit cast to void unless the operand is a non-trivial
// volatile lvalue.
const CastExpr *CE = cast<CastExpr>(this);