summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/template13.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template13.C b/gcc/testsuite/g++.old-deja/g++.ns/template13.C
new file mode 100644
index 00000000000..e1ba30d0328
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/template13.C
@@ -0,0 +1,21 @@
+// Build don't link:
+// Templates defined outside must be declared inside
+namespace bar
+{
+ template<class T>class X;
+}
+
+template <typename T>
+T const
+bar::foo(T const &a)
+{ // ERROR - not declared in bar - XFAIL *-*-*
+ return a;
+}
+
+template<> const int bar::foo<int>(int const &)
+{ // ERROR - not declared in bar - XFAIL *-*-*
+ return 0;
+}
+
+template<class T,class U>
+class bar::X{}; // ERROR - does not match declaration - XFAIL *-*-*
OpenPOWER on IntegriCloud