Skip to content

Commit

Permalink
Convert another case over to RevertingTentativeParsingAction.
Browse files Browse the repository at this point in the history
llvm-svn: 274167
  • Loading branch information
zygoloid committed Jun 29, 2016
1 parent 91b73f2 commit 4556ebe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions clang/lib/Parse/ParseTentative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,15 +1310,14 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
Tok.getAnnotationRange(),
SS);
if (SS.getScopeRep() && SS.getScopeRep()->isDependent()) {
TentativeParsingAction PA(*this);
RevertingTentativeParsingAction PA(*this);
ConsumeToken();
ConsumeToken();
bool isIdentifier = Tok.is(tok::identifier);
TPResult TPR = TPResult::False;
if (!isIdentifier)
TPR = isCXXDeclarationSpecifier(BracedCastResult,
HasMissingTypename);
PA.Revert();

if (isIdentifier ||
TPR == TPResult::True || TPR == TPResult::Error)
Expand All @@ -1330,8 +1329,6 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
*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.
Expand Down

0 comments on commit 4556ebe

Please sign in to comment.