From 21de36ba6656db23c97de8989f0c26ed52204395 Mon Sep 17 00:00:00 2001 From: Larisse Voufo Date: Tue, 6 Aug 2013 03:43:07 +0000 Subject: Moved diagnosis of forward declarations of variable templates from Parser to Sema. llvm-svn: 187768 --- clang/lib/Parse/ParseDecl.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'clang/lib/Parse/ParseDecl.cpp') diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 80fab62f41e..3f15b5b089a 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1801,21 +1801,11 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D, ThisDecl = Actions.ActOnTemplateDeclarator(getCurScope(), *TemplateInfo.TemplateParams, D); - - // If this is a forward declaration of a variable template or variable - // template partial specialization with nested name specifier, complain. - // FIXME: Move to Sema. - CXXScopeSpec &SS = D.getCXXScopeSpec(); - if (Tok.is(tok::semi) && ThisDecl && SS.isNotEmpty() && - (isa(ThisDecl) || - isa(ThisDecl))) { - Diag(SS.getBeginLoc(), diag::err_forward_var_nested_name_specifier) - << isa(ThisDecl) - << SS.getRange(); + if (Tok.is(tok::semi) && + Actions.HandleVariableRedeclaration(ThisDecl, D.getCXXScopeSpec())) { SkipUntil(tok::semi, true, true); return 0; } - if (VarTemplateDecl *VT = ThisDecl ? dyn_cast(ThisDecl) : 0) // Re-direct this decl to refer to the templated decl so that we can -- cgit v1.2.3