From 9c90f7f1b8f52a49254c2337df6f0e8034e19551 Mon Sep 17 00:00:00 2001 From: Larisse Voufo Date: Tue, 6 Aug 2013 05:49:26 +0000 Subject: [PATCH] Removed hack that was used to properly restore the nested name specifier of qualified variable template ids. It turns out that the current implementation was just not logical setup for it. This commit has made it so. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187776 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseExprCXX.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index d4a83fb0c9..9ac6d43506 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -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; -- 2.40.0