From 313a9f46ac8cfae224ccfb2a5ffc88630189d24c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 11 Sep 2013 17:04:24 +0000 Subject: [PATCH] Added regression tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190531 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaTemplate/explicit-instantiation.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 struct X { X() {} }; + template<> struct X { X(); }; + template X::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); + } +} -- 2.50.1