re PR c++/13294 (namespace associations vs. specializations)
authorJason Merrill <jason@redhat.com>
Fri, 26 Mar 2004 19:20:50 +0000 (14:20 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 26 Mar 2004 19:20:50 +0000 (14:20 -0500)
        PR c++/13294
        * pt.c (maybe_process_partial_specialization): Remember the
        context of a specialization.

From-SVN: r79992

gcc/cp/ChangeLog
gcc/cp/pt.c

index e59e9c1a9eca7c0892345986a4719003e17b3577..e3d3a26863796593bc9fc85ba5547115b82bc285 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-25  Jason Merrill  <jason@redhat.com>
+
+       PR c++/13294
+       * pt.c (maybe_process_partial_specialization): Remember the
+       context of a specialization.
+
 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
 
        * cxx-pretty-print.c: Fix comment typos.
index be2f2c7c405c99ef44d3bf0a75e6b6b21a64528f..3e3d0e91f5d16059ff232269e344466659a05a56 100644 (file)
@@ -733,7 +733,15 @@ maybe_process_partial_specialization (tree type)
        {
          tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type));
          if (is_associated_namespace (current_namespace, tpl_ns))
-           /* Same or super-using namespace.  */;
+           /* Same or super-using namespace.  */
+           {
+             if (DECL_NAMESPACE_SCOPE_P (CLASSTYPE_TI_TEMPLATE (type)))
+               /* If this is a specialization of a namespace-scope class
+                  template, remember the context of the
+                  specialization.  */
+               TYPE_CONTEXT (type) = DECL_CONTEXT (TYPE_NAME (type))
+                 = FROB_CONTEXT (current_namespace);
+           }
          else
            {
              pedwarn ("specializing `%#T' in different namespace", type);