New test case
authorMartin v. Löwis <loewis@gcc.gnu.org>
Tue, 10 Aug 1999 16:59:59 +0000 (16:59 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Tue, 10 Aug 1999 16:59:59 +0000 (16:59 +0000)
From-SVN: r28650

gcc/testsuite/g++.old-deja/g++.ns/template12.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template12.C b/gcc/testsuite/g++.old-deja/g++.ns/template12.C
new file mode 100644 (file)
index 0000000..5a6869c
--- /dev/null
@@ -0,0 +1,19 @@
+// Build don't link:
+// Templates can be defined outside of the namespace if the have been declared
+// inside
+namespace bar
+{
+  template <typename T>
+  T const foo(T const &);
+  template<> const int foo<int>(int const &);
+}
+
+template <typename T>
+T const
+bar::foo(T const &a)
+{
+  return a;
+}
+
+template<> const int bar::foo<int>(int const &){return 0;}
+