]> granicus.if.org Git - clang/commitdiff
Added regression tests.
authorSerge Pavlov <sepavloff@gmail.com>
Wed, 11 Sep 2013 17:04:24 +0000 (17:04 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 11 Sep 2013 17:04:24 +0000 (17:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190531 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaTemplate/explicit-instantiation.cpp

index 04a863bdc17e8ea3b3c857fe224c84779ce2b49f..660b627b68cda47505b39d5bdbff53bfd5ae9a73 100644 (file)
@@ -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);
+  }
+}