diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Expr.cpp | 4 |
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); |