aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-02-21 00:56:56 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-02-21 00:56:56 +0000
commit34d49471e0b6386aefdc0f6bd15e4a4876ce5db1 (patch)
treef7f485f0894b02d0f24c28eda6b06875e191ed7a /lib/Sema/SemaStmt.cpp
parent751969957e4cbd4c8b5bf8508ab8620e24743005 (diff)
Clean up the tests for warning about unused function results given the
appropriate attribute. Add a bit more testing that finds a pretty bad regression (since ~forever) in this warning. Fix it with a nice 2 line change. =] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index e995e8f207..49efca8241 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -92,6 +92,8 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S) {
unsigned DiagID = diag::warn_unused_expr;
if (const ExprWithCleanups *Temps = dyn_cast<ExprWithCleanups>(E))
E = Temps->getSubExpr();
+ if (const CXXBindTemporaryExpr *TempExpr = dyn_cast<CXXBindTemporaryExpr>(E))
+ E = TempExpr->getSubExpr();
E = E->IgnoreParenImpCasts();
if (const CallExpr *CE = dyn_cast<CallExpr>(E)) {