2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
authordgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jun 2007 20:21:41 +0000 (20:21 +0000)
committerdgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jun 2007 20:21:41 +0000 (20:21 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126124 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 18da808..8622763 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 6ca072c..3eb6d5d 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 5657411..b8ab6e5 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];
+}