diff options
author | Larisse Voufo <lvoufo@google.com> | 2013-08-06 03:43:07 +0000 |
---|---|---|
committer | Larisse Voufo <lvoufo@google.com> | 2013-08-06 03:43:07 +0000 |
commit | 21de36ba6656db23c97de8989f0c26ed52204395 (patch) | |
tree | ad23d18be0bb427fc8cd8c7a4cf78c6acf28cab9 /clang/lib/Parse | |
parent | cecdabb0bf4cad972e425e481d405580b08a8545 (diff) | |
download | bcm5719-llvm-21de36ba6656db23c97de8989f0c26ed52204395.tar.gz bcm5719-llvm-21de36ba6656db23c97de8989f0c26ed52204395.zip |
Moved diagnosis of forward declarations of variable templates from Parser to Sema.
llvm-svn: 187768
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
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<VarTemplateDecl>(ThisDecl) || - isa<VarTemplatePartialSpecializationDecl>(ThisDecl))) { - Diag(SS.getBeginLoc(), diag::err_forward_var_nested_name_specifier) - << isa<VarTemplatePartialSpecializationDecl>(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<VarTemplateDecl>(ThisDecl) : 0) // Re-direct this decl to refer to the templated decl so that we can |