This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ PATCH] Fix PR c++/31724


This patch fixes PR 31724, a canonical types failure.

Tested powerpc-apple-darwin8.10.0, pre-approved by Mark, and committed.

- Doug

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.

Index: cp/init.c
===================================================================
--- cp/init.c   (revision 126081)
+++ cp/init.c   (working copy)
@@ -1691,6 +1691,7 @@ build_new_1 (tree placement, tree type,
         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: testsuite/g++.dg/other/canon-31724.C
===================================================================
--- testsuite/g++.dg/other/canon-31724.C        (revision 0)
+++ testsuite/g++.dg/other/canon-31724.C        (revision 0)
@@ -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];
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]