]> gcc.gnu.org Git - gcc.git/commitdiff
decl2.c (set_decl_namespace): Allow explicit instantiations in any namespace.
authorMark Mitchell <mark@codesourcery.com>
Mon, 19 Feb 2001 21:47:08 +0000 (21:47 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 19 Feb 2001 21:47:08 +0000 (21:47 +0000)
* decl2.c (set_decl_namespace): Allow explicit instantiations in
any namespace.

From-SVN: r39907

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/g++.old-deja/g++.ns/template15.C [new file with mode: 0644]

index cf3d059f82ff871ae001a5dbb19028b4eda92b55..45c61d1e2690778a6a7494248cd384fe3e784782 100644 (file)
@@ -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
index 51b734fb125c2dc478c8780aba4ab49331e71954..b371611e8ffa5c62b0d3dfe1b60bd039cc86b62c 100644 (file)
@@ -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 (file)
index 0000000..ac78130
--- /dev/null
@@ -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> ();
This page took 0.08031 seconds and 5 git commands to generate.