]> granicus.if.org Git - clang/commitdiff
Removed hack that was used to properly restore the nested name specifier of qualified...
authorLarisse Voufo <lvoufo@google.com>
Tue, 6 Aug 2013 05:49:26 +0000 (05:49 +0000)
committerLarisse Voufo <lvoufo@google.com>
Tue, 6 Aug 2013 05:49:26 +0000 (05:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187776 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExprCXX.cpp

index d4a83fb0c9c389813fb7a7d4a849a17263c54083..9ac6d435067566749fdf9194e4d32e0ba6028c29 100644 (file)
@@ -195,6 +195,13 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
     return false;
   }
 
+  if (Tok.is(tok::annot_template_id)) {
+    // If the current token is an annotated template id, it may already have
+    // a scope specifier. Restore it.
+    TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
+    SS = TemplateId->SS;
+  }
+
   if (LastII)
     *LastII = 0;
 
@@ -561,12 +568,6 @@ ExprResult Parser::ParseCXXIdExpression(bool isAddressOfOperand) {
   //   '::' unqualified-id
   //
   CXXScopeSpec SS;
-  if (Tok.getKind() == tok::annot_template_id) {
-    TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
-    // FIXME: This is a hack for now. It may need to be done from within
-    // ParseUnqualifiedId(), or most likely ParseOptionalCXXScopeSpecifier();
-    SS = TemplateId->SS;
-  }
   ParseOptionalCXXScopeSpecifier(SS, ParsedType(), /*EnteringContext=*/false);
 
   SourceLocation TemplateKWLoc;