Parse the noexcept operator and stub out sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 0268a27..f2cf784 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -457,6 +457,7 @@
/// [GNU] '&&' identifier
/// [C++] new-expression
/// [C++] delete-expression
+/// [C++0x] 'noexcept' '(' expression ')'
///
/// unary-operator: one of
/// '&' '*' '+' '-' '~' '!'
@@ -546,9 +547,9 @@
/// '__is_base_of' [TODO]
///
ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
- bool isAddressOfOperand,
- bool &NotCastExpr,
- ParsedType TypeOfCast) {
+ bool isAddressOfOperand,
+ bool &NotCastExpr,
+ ParsedType TypeOfCast) {
ExprResult Res;
tok::TokenKind SavedKind = Tok.getKind();
NotCastExpr = false;
@@ -891,6 +892,19 @@
case tok::kw_delete: // [C++] delete-expression
return ParseCXXDeleteExpression(false, Tok.getLocation());
+ case tok::kw_noexcept: { // [C++0x] 'noexcept' '(' expression ')'
+ SourceLocation KeyLoc = ConsumeToken();
+ SourceLocation LParen = Tok.getLocation();
+ if (ExpectAndConsume(tok::l_paren,
+ diag::err_expected_lparen_after, "noexcept"))
+ return ExprError();
+ ExprResult Result = ParseExpression();
+ SourceLocation RParen = MatchRHSPunctuation(tok::r_paren, LParen);
+ if (!Result.isInvalid())
+ Result = Actions.ActOnNoexceptExpr(KeyLoc, LParen, Result.take(), RParen);
+ return move(Result);
+ }
+
case tok::kw___is_pod: // [GNU] unary-type-trait
case tok::kw___is_class:
case tok::kw___is_enum: