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 | 60ac1269c639a5969237ba496a3544c9175157f6 (patch) | |
| tree | 1a893bccfb42a4113272203af4cc1180d2b677fa /clang/test/SemaTemplate/explicit-instantiation.cpp | |
| parent | 9519ff59ec0accfeee3bc43ce5c01dd7cbd94850 (diff) | |
| download | bcm5719-llvm-60ac1269c639a5969237ba496a3544c9175157f6.tar.gz bcm5719-llvm-60ac1269c639a5969237ba496a3544c9175157f6.zip | |
Added regression tests.
llvm-svn: 190531
Diffstat (limited to 'clang/test/SemaTemplate/explicit-instantiation.cpp')
| -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); + } +} |

