aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-02-19 21:47:08 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-02-19 21:47:08 +0000
commit2c0fc02de295b3d3eebdf0ff6120de5cab010435 (patch)
tree4e2118b62bf104a661f2b9b758f7fa400ab23fa6 /gcc
parent35ab11f05fb3547f56cdadfed442a7e7d2e9f385 (diff)
downloadgcc-2c0fc02de295b3d3eebdf0ff6120de5cab010435.zip
gcc-2c0fc02de295b3d3eebdf0ff6120de5cab010435.tar.gz
gcc-2c0fc02de295b3d3eebdf0ff6120de5cab010435.tar.bz2
decl2.c (set_decl_namespace): Allow explicit instantiations in any namespace.
* decl2.c (set_decl_namespace): Allow explicit instantiations in any namespace. From-SVN: r39907
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/template15.C5
3 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cf3d059..45c61d1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-19 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (set_decl_namespace): Allow explicit instantiations in
+ any namespace.
+
2001-02-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* optimize.c (expand_call_inline): Don't walk subtrees of type
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 51b734f..b371611 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4536,6 +4536,9 @@ set_decl_namespace (decl, scope, friendp)
if (!old)
/* No old declaration at all. */
goto complain;
+ /* A template can be explicitly specialized in any namespace. */
+ if (processing_explicit_instantiation)
+ return;
if (!is_overloaded_fn (decl))
/* Don't compare non-function decls with decls_match here,
since it can't check for the correct constness at this
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template15.C b/gcc/testsuite/g++.old-deja/g++.ns/template15.C
new file mode 100644
index 0000000..ac78130
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/template15.C
@@ -0,0 +1,5 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+namespace X { template <class T> void f () {} }
+template void X::f<int> ();