diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2013-09-11 17:04:24 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2013-09-11 17:04:24 +0000 |
commit | 313a9f46ac8cfae224ccfb2a5ffc88630189d24c (patch) | |
tree | 0692a7228fe22aa26ed54cb4fd7f433996a2aced /test/SemaTemplate | |
parent | d8dfae602d7b2e42b0eef6b1e7779c96833f83c1 (diff) | |
download | clang-313a9f46ac8cfae224ccfb2a5ffc88630189d24c.tar.gz |
Added regression tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/explicit-instantiation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/explicit-instantiation.cpp b/test/SemaTemplate/explicit-instantiation.cpp index 04a863bdc1..660b627b68 100644 --- a/test/SemaTemplate/explicit-instantiation.cpp +++ b/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); + } +} |