]> granicus.if.org Git - clang/commitdiff
Convert another case over to RevertingTentativeParsingAction.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 29 Jun 2016 21:12:37 +0000 (21:12 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 29 Jun 2016 21:12:37 +0000 (21:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274167 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseTentative.cpp

index 7415b8cd845e8549e5008fc7bae460eba1c5a3ac..c79208a00194e31914cb2042d8dc50e861b6a91f 100644 (file)
@@ -1310,7 +1310,7 @@ 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);
@@ -1318,7 +1318,6 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
           if (!isIdentifier)
             TPR = isCXXDeclarationSpecifier(BracedCastResult,
                                             HasMissingTypename);
-          PA.Revert();
 
           if (isIdentifier ||
               TPR == TPResult::True || TPR == TPResult::Error)
@@ -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.