aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@gcc.gnu.org>1999-08-10 16:59:59 +0000
committerMartin v. Löwis <loewis@gcc.gnu.org>1999-08-10 16:59:59 +0000
commitfbb72466580f54d1b43a42d9845107e488627241 (patch)
treec248f82afc9dd5d0ff9e29ed9052dfdf1d24801d /gcc
parentd82d65d886aa88cd38f03c768a6bd3aac3dc21f2 (diff)
downloadgcc-fbb72466580f54d1b43a42d9845107e488627241.zip
gcc-fbb72466580f54d1b43a42d9845107e488627241.tar.gz
gcc-fbb72466580f54d1b43a42d9845107e488627241.tar.bz2
New test case
From-SVN: r28650
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/template12.C19
1 files changed, 19 insertions, 0 deletions
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
index 0000000..5a6869c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/template12.C
@@ -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;}
+