summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-16 07:57:51 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-16 07:57:51 +0000
commit6336be2d93b5898ffd78bce0ee802c77eefb5c20 (patch)
tree0ff816e191ef22c77d83b7424b5d60465c5a2166
parent75a38c203829919993f18fc6e2377ee26d363be2 (diff)
downloadppe42-gcc-6336be2d93b5898ffd78bce0ee802c77eefb5c20.tar.gz
ppe42-gcc-6336be2d93b5898ffd78bce0ee802c77eefb5c20.zip
* pt.c (push_template_decl_real): Don't remangle the name of a
class template. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39752 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend48.C17
3 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 92f434b17e2..a4413a97e8a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f82981bd979..2f34815274b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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
index 00000000000..af0e3caf15c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend48.C
@@ -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;
+};
+};
OpenPOWER on IntegriCloud