diff options
| -rw-r--r-- | clang/test/SemaTemplate/explicit-instantiation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/explicit-instantiation.cpp b/clang/test/SemaTemplate/explicit-instantiation.cpp index 04a863bdc17..660b627b68c 100644 --- a/clang/test/SemaTemplate/explicit-instantiation.cpp +++ b/clang/test/SemaTemplate/explicit-instantiation.cpp @@ -106,3 +106,16 @@ class TC1 { void foo() { } }; }; + +namespace PR8020 { + template <typename T> struct X { X() {} }; + template<> struct X<int> { X(); }; + template X<int>::X() {} // expected-error{{function cannot be defined in an explicit instantiation}} +} + +namespace PR10086 { + template void foobar(int i) {} // expected-error{{function cannot be defined in an explicit instantiation}} + int func() { + foobar(5); + } +} |

