summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
authorLarisse Voufo <lvoufo@google.com>2013-08-06 03:43:07 +0000
committerLarisse Voufo <lvoufo@google.com>2013-08-06 03:43:07 +0000
commit21de36ba6656db23c97de8989f0c26ed52204395 (patch)
treead23d18be0bb427fc8cd8c7a4cf78c6acf28cab9 /clang/lib/Parse
parentcecdabb0bf4cad972e425e481d405580b08a8545 (diff)
downloadbcm5719-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.cpp14
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
OpenPOWER on IntegriCloud