[cfe-commits] r60423 - in /cfe/trunk/lib/Parse: ParseExpr.cpp ParseExprCXX.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Tue Dec 2 09:10:30 PST 2008
Author: cornedbee
Date: Tue Dec 2 11:10:24 2008
New Revision: 60423
URL: http://llvm.org/viewvc/llvm-project?rev=60423&view=rev
Log:
Add better comments to ::new parsing. Thanks to Doug for the review.
Modified:
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=60423&r1=60422&r2=60423&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Dec 2 11:10:24 2008
@@ -639,6 +639,8 @@
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
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=60423&r1=60422&r2=60423&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Tue Dec 2 11:10:24 2008
@@ -38,8 +38,8 @@
(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;
More information about the cfe-commits
mailing list