From bfa8d90b86902ae3da926c63f70b0d8d76650abc Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 29 Jun 2007 20:21:41 +0000 Subject: [PATCH] re PR c++/31724 (More "same canonical type node" fun) 2007-06-29 Douglas Gregor PR c++/31724 * init.c (build_new_1): Use structural equality on the copy of the array type. 2007-06-29 Douglas Gregor * g++.dg/other/canon-31724.C: New. From-SVN: r126124 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/init.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/other/canon-31724.C | 8 ++++++++ 4 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/other/canon-31724.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 18da8087f4e..86227638e03 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-06-29 Douglas Gregor + + PR c++/31724 + * init.c (build_new_1): Use structural equality on the copy of the + array type. + 2007-06-28 Geoffrey Keating * decl2.c (determine_visibility): Implement diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 6ca072ca5d4..3eb6d5d97a9 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1691,6 +1691,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, of the incomplete array type. */ full_type = build_distinct_type_copy (full_type); TYPE_DOMAIN (full_type) = index; + SET_TYPE_STRUCTURAL_EQUALITY (full_type); } else { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5657411231d..b8ab6e54a03 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-06-29 Douglas Gregor + + * g++.dg/other/canon-31724.C: New. + 2007-06-29 Jan Hubicka PR middle-end/32372 @@ -47,6 +51,7 @@ PR tree-opt/32417 * gfortran.fortran-torture/compile/pr32417.f90: New test. +>>>>>>> .r126123 2007-06-28 Dorit Nuzman * gcc.dg/vect/vect-iv-4.c: Test now passes on vect_pack_trunc diff --git a/gcc/testsuite/g++.dg/other/canon-31724.C b/gcc/testsuite/g++.dg/other/canon-31724.C new file mode 100644 index 00000000000..1a39f78a097 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/canon-31724.C @@ -0,0 +1,8 @@ +struct ac {ac();}; +ac spline_rep1(void) +{ + typedef ac at[2]; + ac * b = new ac[2]; + at *a = (at*)b; + return (*a)[0]; +} -- 2.30.2