aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-02-20 19:31:38 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-02-20 19:31:38 +0000
commit63a3cd3ec3b7c5862b0be1512fca62f6158c4df2 (patch)
treeae32997dc237be62535411dc0f87af9ba650134f /gcc
parenta62bfff255032cd0f08b91f2a40f22dccb39e88c (diff)
downloadgcc-63a3cd3ec3b7c5862b0be1512fca62f6158c4df2.zip
gcc-63a3cd3ec3b7c5862b0be1512fca62f6158c4df2.tar.gz
gcc-63a3cd3ec3b7c5862b0be1512fca62f6158c4df2.tar.bz2
re PR c++/9729 (ICE in mangle_conv_op_name_for_type, at cp/mangle.c:2612)
PR c++/9729 * g++.dg/abi/conv1.C: New test. PR c++/9729 * mangle.c (mangle_conv_op_name_for_type): Issue an error message when the G++ 3.2 ABI prevents correct compilation. From-SVN: r63176
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/mangle.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/abi/conv1.C13
4 files changed, 35 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e013cf0..8fa71ad 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9729
+ * mangle.c (mangle_conv_op_name_for_type): Issue an error message
+ when the G++ 3.2 ABI prevents correct compilation.
+
2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
Change base class access representation. Share virtual base
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index fae2237..06d8f96 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1,5 +1,5 @@
/* Name mangling for the 3.0 C++ ABI.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Alex Samuel <sameul@codesourcery.com>
This file is part of GCC.
@@ -2644,9 +2644,16 @@ mangle_conv_op_name_for_type (type)
free (op_name);
/* It had better be a unique mangling for the type. */
- my_friendly_assert (!IDENTIFIER_TYPENAME_P (identifier)
- || same_type_p (type, TREE_TYPE (identifier)),
- 20011230);
+ if (IDENTIFIER_TYPENAME_P (identifier)
+ && !same_type_p (type, TREE_TYPE (identifier)))
+ {
+ /* In G++ 3.2, the name mangling scheme was ambiguous. In later
+ versions of the ABI, this problem has been fixed. */
+ if (abi_version_at_least (2))
+ abort ();
+ error ("due to a defect in the G++ 3.2 ABI, G++ has assigned the "
+ "same mangled name to two different types");
+ }
/* Set bits on the identifier so we know later it's a conversion. */
IDENTIFIER_OPNAME_P (identifier) = 1;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d1410d3..603ae10 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9729
+ * g++.dg/abi/conv1.C: New test.
+
Thu Feb 20 14:38:13 CET 2003 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/execute/20020720-1.x: XFAIL for x86-64.
diff --git a/gcc/testsuite/g++.dg/abi/conv1.C b/gcc/testsuite/g++.dg/abi/conv1.C
new file mode 100644
index 0000000..fdedea2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/conv1.C
@@ -0,0 +1,13 @@
+// { dg-options "-fabi-version=1" }
+
+template<class T1>
+struct A {
+ typedef typename T1::X X;
+ operator X() const;
+};
+
+template <class T0, class T1 >
+struct B {
+ typedef typename T1::X X;
+ operator X() const; // { dg-error "" }
+};