re PR c++/31724 (More "same canonical type node" fun)
authorDoug Gregor <dgregor@gcc.gnu.org>
Fri, 29 Jun 2007 20:21:41 +0000 (20:21 +0000)
committerDoug Gregor <dgregor@gcc.gnu.org>
Fri, 29 Jun 2007 20:21:41 +0000 (20:21 +0000)
2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>

PR c++/31724
* init.c (build_new_1): Use structural equality on the copy of the
array type.

2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>

* g++.dg/other/canon-31724.C: New.

From-SVN: r126124

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/canon-31724.C [new file with mode: 0644]

index 18da8087f4ed5524015cc5df5fd4eec04fa80059..86227638e03b1593d1adf37430ddc95b48765700 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
+
+       PR c++/31724
+       * init.c (build_new_1): Use structural equality on the copy of the
+       array type.
+
 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
 
        * decl2.c (determine_visibility): Implement
index 6ca072ca5d467ae3e1e8fcce544522d6397fc656..3eb6d5d97a9eb1928d44c6256913f0b2033b8db6 100644 (file)
@@ -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
     {
index 5657411231d508287b669fb6b50d7a84fb03526d..b8ab6e54a03d2f0fb0365b02b664556f9172cd59 100644 (file)
@@ -1,3 +1,7 @@
+2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * g++.dg/other/canon-31724.C: New.
+       
 2007-06-29  Jan Hubicka  <jh@suse.cz>
 
        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  <dorit@il.ibm.com>
 
        * 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 (file)
index 0000000..1a39f78
--- /dev/null
@@ -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];
+}