forked from OSchip/llvm-project
Don't emit -Wunused-value warnings from macro expansions.
llvm-svn: 166522
This commit is contained in:
parent
949cc50962
commit
493d6d55ba
|
@ -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);
|
||||
|
|
|
@ -122,3 +122,10 @@ void f(int i, ...) {
|
|||
|
||||
// PR8371
|
||||
int fn5() __attribute__ ((__const));
|
||||
|
||||
// OpenSSL has some macros like this.
|
||||
#define M(a, b) (long)foo((a), (b))
|
||||
void t11(int i, int j) {
|
||||
M(i, j); // no warning
|
||||
}
|
||||
#undef M
|
||||
|
|
Loading…
Reference in New Issue