r274167 - Convert another case over to RevertingTentativeParsingAction.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 29 14:12:37 PDT 2016
Author: rsmith
Date: Wed Jun 29 16:12:37 2016
New Revision: 274167
URL: http://llvm.org/viewvc/llvm-project?rev=274167&view=rev
Log:
Convert another case over to RevertingTentativeParsingAction.
Modified:
cfe/trunk/lib/Parse/ParseTentative.cpp
Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=274167&r1=274166&r2=274167&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Wed Jun 29 16:12:37 2016
@@ -1310,7 +1310,7 @@ Parser::isCXXDeclarationSpecifier(Parser
Tok.getAnnotationRange(),
SS);
if (SS.getScopeRep() && SS.getScopeRep()->isDependent()) {
- TentativeParsingAction PA(*this);
+ RevertingTentativeParsingAction PA(*this);
ConsumeToken();
ConsumeToken();
bool isIdentifier = Tok.is(tok::identifier);
@@ -1318,7 +1318,6 @@ Parser::isCXXDeclarationSpecifier(Parser
if (!isIdentifier)
TPR = isCXXDeclarationSpecifier(BracedCastResult,
HasMissingTypename);
- PA.Revert();
if (isIdentifier ||
TPR == TPResult::True || TPR == TPResult::Error)
@@ -1330,8 +1329,6 @@ Parser::isCXXDeclarationSpecifier(Parser
*HasMissingTypename = true;
return TPResult::Ambiguous;
}
-
- // FIXME: Fails to either revert or commit the tentative parse!
} else {
// Try to resolve the name. If it doesn't exist, assume it was
// intended to name a type and keep disambiguating.
More information about the cfe-commits
mailing list