diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-23 14:50:21 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-23 14:50:21 +0000 |
| commit | d6aff018d446f22be4e4e0277080ebfa5b157288 (patch) | |
| tree | 64b43af65e97f7659637c9ac028e39af2e26b841 /lib/Parse | |
| parent | b897c8660c4ff7037dde81b9645737bc1c992abe (diff) | |
Notes
Diffstat (limited to 'lib/Parse')
| -rw-r--r-- | lib/Parse/ParseDecl.cpp | 2 | ||||
| -rw-r--r-- | lib/Parse/ParseExpr.cpp | 9 | ||||
| -rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 7 | ||||
| -rw-r--r-- | lib/Parse/ParseTemplate.cpp | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 69152523a112..426f56f4380e 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -273,7 +273,7 @@ AttributeList* Parser::ParseMicrosoftTypeAttributes(AttributeList *CurrAttr) { /// [C++] template-declaration /// [C++] namespace-definition /// [C++] using-directive -/// [C++] using-declaration [TODO] +/// [C++] using-declaration /// [C++0x] static_assert-declaration /// others... [FIXME] /// diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 4a07d05650bd..13b32acd5b29 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -279,7 +279,8 @@ Parser::OwningExprResult Parser::ParseConstantExpression() { // C++ [basic.def.odr]p2: // An expression is potentially evaluated unless it appears where an // integral constant expression is required (see 5.19) [...]. - EnterUnevaluatedOperand Unevaluated(Actions); + EnterExpressionEvaluationContext Unevaluated(Actions, + Action::Unevaluated); OwningExprResult LHS(ParseCastExpression(false)); if (LHS.isInvalid()) return move(LHS); @@ -983,7 +984,8 @@ Parser::ParseExprAfterTypeofSizeofAlignof(const Token &OpTok, // // The GNU typeof and alignof extensions also behave as unevaluated // operands. - EnterUnevaluatedOperand Unevaluated(Actions); + EnterExpressionEvaluationContext Unevaluated(Actions, + Action::Unevaluated); Operand = ParseCastExpression(true/*isUnaryExpression*/); } else { // If it starts with a '(', we know that it is either a parenthesized @@ -999,7 +1001,8 @@ Parser::ParseExprAfterTypeofSizeofAlignof(const Token &OpTok, // // The GNU typeof and alignof extensions also behave as unevaluated // operands. - EnterUnevaluatedOperand Unevaluated(Actions); + EnterExpressionEvaluationContext Unevaluated(Actions, + Action::Unevaluated); Operand = ParseParenExpression(ExprType, true/*stopIfCastExpr*/, CastTy, RParenLoc); CastRange = SourceRange(LParenLoc, RParenLoc); diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index 87aa5dc67116..2be44a4e77a0 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -384,10 +384,9 @@ Parser::OwningExprResult Parser::ParseCXXTypeid() { // // Note that we can't tell whether the expression is an lvalue of a // polymorphic class type until after we've parsed the expression, so - // we treat the expression as an unevaluated operand and let semantic - // analysis cope with case where the expression is not an unevaluated - // operand. - EnterUnevaluatedOperand Unevaluated(Actions); + // we the expression is potentially potentially evaluated. + EnterExpressionEvaluationContext Unevaluated(Actions, + Action::PotentiallyPotentiallyEvaluated); Result = ParseExpression(); // Match the ')'. diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index a9f75d8be17d..eabe10f1450e 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -750,7 +750,7 @@ void Parser::AnnotateTemplateIdTokenAsType(const CXXScopeSpec *SS) { /// ParseTemplateArgument - Parse a C++ template argument (C++ [temp.names]). /// /// template-argument: [C++ 14.2] -/// assignment-expression +/// constant-expression /// type-id /// id-expression void *Parser::ParseTemplateArgument(bool &ArgIsType) { @@ -768,7 +768,7 @@ void *Parser::ParseTemplateArgument(bool &ArgIsType) { return TypeArg.get(); } - OwningExprResult ExprArg = ParseAssignmentExpression(); + OwningExprResult ExprArg = ParseConstantExpression(); if (ExprArg.isInvalid() || !ExprArg.get()) return 0; |
