diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-04-17 02:56:49 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-04-17 02:56:49 +0000 |
commit | 0d963d6c491081249d797c0482089521d02aee53 (patch) | |
tree | 2e22bbfb131ae0d9bd88f75ca26c4cf7570062ef /clang/lib/Sema/SemaDecl.cpp | |
parent | ec328b8e6f1b0fee6c6ebe40ee97ed2e7acfaa14 (diff) | |
download | bcm5719-llvm-0d963d6c491081249d797c0482089521d02aee53.tar.gz bcm5719-llvm-0d963d6c491081249d797c0482089521d02aee53.zip |
Don't emit an ExtWarn on declarations of variable template specializations;
we'll already have issued the relevant diagnostic when we saw the declaration
of the primary template.
llvm-svn: 206441
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 13725dc3f39..fb2049f6eae 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5263,12 +5263,6 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC, TemplateParams->getRAngleLoc()); TemplateParams = 0; } else { - // Only C++1y supports variable templates (N3651). - Diag(D.getIdentifierLoc(), - getLangOpts().CPlusPlus1y - ? diag::warn_cxx11_compat_variable_template - : diag::ext_variable_template); - if (D.getName().getKind() == UnqualifiedId::IK_TemplateId) { // This is an explicit specialization or a partial specialization. // FIXME: Check that we can declare a specialization here. @@ -5281,6 +5275,12 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC, // Check that we can declare a template here. if (CheckTemplateDeclScope(S, TemplateParams)) return 0; + + // Only C++1y supports variable templates (N3651). + Diag(D.getIdentifierLoc(), + getLangOpts().CPlusPlus1y + ? diag::warn_cxx11_compat_variable_template + : diag::ext_variable_template); } } } |