aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-01-06 22:43:58 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-01-06 22:43:58 +0000
commitd87a0cd2b3e1c9e9f01212875f4cbe5b7bb7ab57 (patch)
tree6919ce0acbee739edf215e680d38e224d0c18c86 /lib/Sema/SemaStmt.cpp
parentcd93b96bc51c255d104095bc6a6d8eac74a84b1e (diff)
Suppress -Wunused-value within macros from system headers.
Along the way, move a helper function from SemaChecking.cpp to a more accessible home in SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index d7489d418e..78a58964db 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -152,7 +152,8 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S) {
SourceLocation Loc;
SourceRange R1, R2;
- if (!E->isUnusedResultAWarning(Loc, R1, R2, Context))
+ if (SourceMgr.isInSystemMacro(E->getExprLoc()) ||
+ !E->isUnusedResultAWarning(Loc, R1, R2, Context))
return;
// Okay, we have an unused result. Depending on what the base expression is,