diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Parse/ParseExpr.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 4 | 
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index 50b3a7a4ef9..52caffbb7fc 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -639,6 +639,8 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {      return ParsePostfixExpressionSuffix(Res);    case tok::coloncolon: // [C++] new-expression or [C++] delete-expression +    // If the next token is neither 'new' nor 'delete', the :: would have been +    // parsed as a scope specifier already.      if (NextToken().is(tok::kw_new))        return ParseCXXNewExpression();      else diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index 5d790fa34cd..c126b433dd7 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -38,8 +38,8 @@ bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS) {        (Tok.isNot(tok::identifier) || NextToken().isNot(tok::coloncolon)))      return false; -  // Don't parse ::new and ::delete as scope specifiers. It would only make -  // things a lot more complicated. +  // ::new and ::delete aren'T nested-name-specifiers, so parsing the :: as +  // a scope specifier only makes things more complicated.    if (Tok.is(tok::coloncolon) && (NextToken().is(tok::kw_new) ||                                    NextToken().is(tok::kw_delete)))      return false;  | 

