aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Parse/ParseExpr.cpp4
-rw-r--r--lib/Sema/SemaExprCXX.cpp5
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index f2cf78492c..1c2b343141 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -898,6 +898,10 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
if (ExpectAndConsume(tok::l_paren,
diag::err_expected_lparen_after, "noexcept"))
return ExprError();
+ // C++ [expr.unary.noexcept]p1:
+ // The noexcept operator determines whether the evaluation of its operand,
+ // which is an unevaluated operand, can throw an exception.
+ EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
ExprResult Result = ParseExpression();
SourceLocation RParen = MatchRHSPunctuation(tok::r_paren, LParen);
if (!Result.isInvalid())
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 8e29caa6a1..382e9bb185 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -3116,11 +3116,6 @@ CXXMemberCallExpr *Sema::BuildCXXMemberCallExpr(Expr *Exp,
ExprResult Sema::BuildCXXNoexceptExpr(SourceLocation KeyLoc, Expr *Operand,
SourceLocation RParen) {
- // C++ [expr.unary.noexcept]p1:
- // The noexcept operator determines whether the evaluation of its operand,
- // which is an unevaluated operand, can throw an exception.
- ExprEvalContexts.back().Context = Unevaluated;
-
return Owned(new (Context) CXXNoexceptExpr(Context.BoolTy, Operand,
Operand->CanThrow(Context),
KeyLoc, RParen));