]> gcc.gnu.org Git - gcc.git/commitdiff
pt.c (push_template_decl_real): Don't remangle the name of a class template.
authorMark Mitchell <mark@codesourcery.com>
Fri, 16 Feb 2001 07:57:51 +0000 (07:57 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 16 Feb 2001 07:57:51 +0000 (07:57 +0000)
* pt.c (push_template_decl_real): Don't remangle the name of a
class template.

From-SVN: r39752

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

index 92f434b17e2b7d14314fdea6dcb14fb2ab420c86..a4413a97e8a9865579e6c55728a8924ede048af7 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-15  Mark Mitchell  <mark@codesourcery.com>
+
+       * pt.c (push_template_decl_real): Don't remangle the name of a
+       class template.
+
 2001-02-15  Jim Meyering  <meyering@lucent.com>
 
        * Make-lang.in (c++.install-common): Depend on installdirs.
index f82981bd97994cbfbbd0cbbefda1018079b217b4..2f34815274b4fe19859f13799c177e5e6805bd58 100644 (file)
@@ -2718,7 +2718,9 @@ push_template_decl_real (decl, is_friend)
     {
       SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);
       if ((!ctx || TREE_CODE (ctx) != FUNCTION_DECL)
-         && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE)
+         && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE
+         /* Don't change the name if we've already set it up.  */
+         && !IDENTIFIER_TEMPLATE (DECL_NAME (decl)))
        DECL_NAME (decl) = classtype_mangled_name (TREE_TYPE (decl));
     }
   else if (DECL_LANG_SPECIFIC (decl))
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend48.C b/gcc/testsuite/g++.old-deja/g++.pt/friend48.C
new file mode 100644 (file)
index 0000000..af0e3ca
--- /dev/null
@@ -0,0 +1,17 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+class C {
+  template <class U>
+  friend class ::C;
+};
+
+namespace N 
+{
+template <class T>
+class D {
+  template <class U>
+  friend class N::D;
+};
+};
This page took 0.084848 seconds and 5 git commands to generate.