diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-02-02 16:35:43 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-02-02 16:35:43 +0000 |
commit | b72839f22820b010628a9a4003bfb14a05b0102c (patch) | |
tree | fe1d43b5588f2815082306040ea8ac112c96e97c /test/SemaTemplate/class-template-decl.cpp | |
parent | 096b70c87d7f7c461aedd662a24dd83760a6273f (diff) | |
download | clang-b72839f22820b010628a9a4003bfb14a05b0102c.tar.gz |
Sema: Reject templates in all extern "C" contexts.
Otherwise we'd accept them if the LinkageDecl was not the direct
parent DeclContext. PR17968.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/class-template-decl.cpp')
-rw-r--r-- | test/SemaTemplate/class-template-decl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaTemplate/class-template-decl.cpp b/test/SemaTemplate/class-template-decl.cpp index e65da2b312..b721aab354 100644 --- a/test/SemaTemplate/class-template-decl.cpp +++ b/test/SemaTemplate/class-template-decl.cpp @@ -14,6 +14,13 @@ extern "C" { template<typename T> class D; // expected-error{{templates must have C++ linkage}} } +extern "C" { + class PR17968 { + template<typename T> class D; // expected-error{{templates must have C++ linkage}} + template<typename T> void f(); // expected-error{{templates must have C++ linkage}} + }; +} + template<class U> class A; // expected-note{{previous template declaration is here}} template<int N> class A; // expected-error{{template parameter has a different kind in template redeclaration}} |