summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-02-13 10:47:50 +0000
committerHans Wennborg <hans@hanshq.net>2019-02-13 10:47:50 +0000
commit61fc5f8f40a473b160a06bda016905d831eeff14 (patch)
treef23b36a55baca4dd784f500fa9736b2332c667a6 /lib/Sema/SemaExpr.cpp
parent8ffe5246a3a29bb151f1ad261a5d342f5d328eff (diff)
Revert r350404
This caused https://bugs.llvm.org/show_bug.cgi?id=40642: "After 350404, clang drops volatile load" > Refactor the way we handle diagnosing unused expression results. > > Rather than sprinkle calls to DiagnoseUnusedExprResult() around in places > where we want diagnostics, we now diagnose unused expression statements and > full expressions in a more generic way when acting on the final expression > statement. This results in more appropriate diagnostics for [[nodiscard]] where > we were previously lacking them, such as when the body of a for loop is not a > compound statement. > > This patch fixes PR39837. git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_80@353935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 2bcd47abe3..db0c62630a 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4723,9 +4723,8 @@ bool Sema::CheckCXXDefaultArgExpr(SourceLocation CallLoc, FunctionDecl *FD,
if (Result.isInvalid())
return true;
- Result =
- ActOnFinishFullExpr(Result.getAs<Expr>(), Param->getOuterLocStart(),
- /*DiscardedValue*/ false);
+ Result = ActOnFinishFullExpr(Result.getAs<Expr>(),
+ Param->getOuterLocStart());
if (Result.isInvalid())
return true;