Skip to content
Snippets Groups Projects
Commit 9e03e89d authored by Richard Smith's avatar Richard Smith
Browse files

Convert another case over to RevertingTentativeParsingAction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274167 91177308-0d34-0410-b5e6-96231b3b80d8
parent 5a3aa239
No related branches found
No related tags found
No related merge requests found
...@@ -1310,7 +1310,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult, ...@@ -1310,7 +1310,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
Tok.getAnnotationRange(), Tok.getAnnotationRange(),
SS); SS);
if (SS.getScopeRep() && SS.getScopeRep()->isDependent()) { if (SS.getScopeRep() && SS.getScopeRep()->isDependent()) {
TentativeParsingAction PA(*this); RevertingTentativeParsingAction PA(*this);
ConsumeToken(); ConsumeToken();
ConsumeToken(); ConsumeToken();
bool isIdentifier = Tok.is(tok::identifier); bool isIdentifier = Tok.is(tok::identifier);
...@@ -1318,7 +1318,6 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult, ...@@ -1318,7 +1318,6 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
if (!isIdentifier) if (!isIdentifier)
TPR = isCXXDeclarationSpecifier(BracedCastResult, TPR = isCXXDeclarationSpecifier(BracedCastResult,
HasMissingTypename); HasMissingTypename);
PA.Revert();
if (isIdentifier || if (isIdentifier ||
TPR == TPResult::True || TPR == TPResult::Error) TPR == TPResult::True || TPR == TPResult::Error)
...@@ -1330,8 +1329,6 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult, ...@@ -1330,8 +1329,6 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
*HasMissingTypename = true; *HasMissingTypename = true;
return TPResult::Ambiguous; return TPResult::Ambiguous;
} }
// FIXME: Fails to either revert or commit the tentative parse!
} else { } else {
// Try to resolve the name. If it doesn't exist, assume it was // Try to resolve the name. If it doesn't exist, assume it was
// intended to name a type and keep disambiguating. // intended to name a type and keep disambiguating.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment