diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-02-21 00:56:56 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-02-21 00:56:56 +0000 |
commit | d05b352b0e5b036d67e9916936b1e59e742039fd (patch) | |
tree | f248619ab69c1d7d75b63432eb58bd234528c73a /clang/lib/Sema/SemaStmt.cpp | |
parent | 8731d0cc836cc879f5a7d32248cdd9ccf4e3b69e (diff) | |
download | bcm5719-llvm-d05b352b0e5b036d67e9916936b1e59e742039fd.tar.gz bcm5719-llvm-d05b352b0e5b036d67e9916936b1e59e742039fd.zip |
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. =]
llvm-svn: 126098
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index e995e8f207d..49efca82412 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/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)) { |