aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-02-29 23:10:43 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-02-29 23:10:43 +0000
commit39876352716051ef43f55ba526b907ae86ae55a9 (patch)
tree5930b373d34c33710c6c6db49746e7cac225ad01 /gcc
parent8bb915b65498bcfd9769ba28438140e4006b9d3e (diff)
downloadgcc-39876352716051ef43f55ba526b907ae86ae55a9.zip
gcc-39876352716051ef43f55ba526b907ae86ae55a9.tar.gz
gcc-39876352716051ef43f55ba526b907ae86ae55a9.tar.bz2
re PR debug/12103 (-g only crash (segfault) with a forward declared class used as a template parameter)
PR debug/12103 * class.c (update_vtable_entry_for_fn): Do not go through covariance machinery if the type returned by an overrider is the same as the original. PR debug/12103 * g++.dg/debug/crash1.C: New test. From-SVN: r78680
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/debug/crash1.C17
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2c05b71..979f578 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/12103
+ * class.c (update_vtable_entry_for_fn): Do not go through
+ covariance machinery if the type returned by an overrider is the
+ same as the original.
+
2004-02-29 Kazu Hirata <kazu@cs.umass.edu>
* call.c: Fix a comment typo.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f09368f..3a34ce45 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2090,7 +2090,8 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
TREE_VALUE (purpose_member
(BINFO_TYPE (virtual_offset),
CLASSTYPE_VBASECLASSES (TREE_TYPE (over_return))));
- else
+ else if (!same_type_p (TREE_TYPE (over_return),
+ TREE_TYPE (base_return)))
{
/* There was no existing virtual thunk (which takes
precedence). */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 650c6fc..b5aa29d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR debug/12103
+ * g++.dg/debug/crash1.C: New test.
+
2004-02-29 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/sibcall-3.c (recurser_void1): Make it an extern
diff --git a/gcc/testsuite/g++.dg/debug/crash1.C b/gcc/testsuite/g++.dg/debug/crash1.C
new file mode 100644
index 0000000..4fba256
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/crash1.C
@@ -0,0 +1,17 @@
+template <typename T>
+class foo
+{
+ T t;
+};
+
+class bar;
+typedef foo<bar> foobar;
+
+class obj
+{
+ virtual foobar* yeah() = 0;
+};
+
+class bar : virtual public obj
+{
+};