summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-template-decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-09 22:14:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-09 22:14:25 +0000
commit3af700977bdc3047044f22409f0e8aa24daae0f7 (patch)
tree25c7ce87b0791470cdd2d220a8d02256a3c8f162 /clang/test/Parser/cxx-template-decl.cpp
parent546bc1103b682c4ea66116ddaf0fc6fdf0a8bdd5 (diff)
downloadbcm5719-llvm-3af700977bdc3047044f22409f0e8aa24daae0f7.tar.gz
bcm5719-llvm-3af700977bdc3047044f22409f0e8aa24daae0f7.zip
Diagnose attempts to explicitly instantiate a template at class scope. Previously Clang would simply ignore the 'template' keyword in this case.
llvm-svn: 294639
Diffstat (limited to 'clang/test/Parser/cxx-template-decl.cpp')
-rw-r--r--clang/test/Parser/cxx-template-decl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-template-decl.cpp b/clang/test/Parser/cxx-template-decl.cpp
index efa42ad30d0..9ad422e7ab7 100644
--- a/clang/test/Parser/cxx-template-decl.cpp
+++ b/clang/test/Parser/cxx-template-decl.cpp
@@ -238,3 +238,13 @@ struct t2 : base<int,
// expected-error@-1 {{expected '{' after base class list}}
}
+
+namespace class_scope_instantiation {
+ struct A {
+ template<typename T> void f(T);
+ template void f<int>(int); // expected-error {{expected '<' after 'template'}}
+ template void f(float); // expected-error {{expected '<' after 'template'}}
+ extern template // expected-error {{expected member name or ';'}}
+ void f(double);
+ };
+}
OpenPOWER on IntegriCloud