re PR c++/21645 (C++ ICE in cxx_types_compatible_p)
authorAndrew Pinski <pinskia@physics.uc.edu>
Tue, 24 May 2005 19:06:20 +0000 (19:06 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 24 May 2005 19:06:20 +0000 (12:06 -0700)
2005-05-24  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/21645
        * g++.dg/init/ctor5.C: New test.

2005-05-24  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/21645
        * optimize.c (update_cloned_parm): Copy the TYPE also from the
        original one.

From-SVN: r100106

gcc/cp/ChangeLog
gcc/cp/optimize.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/ctor5.C [new file with mode: 0644]

index 91a41c3408f278abacc40aa34a3a2fd1840539d8..f15e1e92a3ca6ae5920fd996bb0288fa9694ac04 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-24  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR C++/21645
+       * optimize.c (update_cloned_parm): Copy the TYPE also from the
+       original one.
+
 2005-05-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/21495
index 7ccfaffbf0db38ab8ed0a1e73e422bc3207f39a8..bf9b22b63e915c22b537632dc67213a318b4d058 100644 (file)
@@ -68,6 +68,7 @@ update_cloned_parm (tree parm, tree cloned_parm)
   /* The name may have changed from the declaration.  */
   DECL_NAME (cloned_parm) = DECL_NAME (parm);
   DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm);
+  TREE_TYPE (cloned_parm) = TREE_TYPE (parm);
 }
 
 /* FN is a function that has a complete body.  Clone the body as
index b742080db94fd6c3de41a35bad1f8aad00174d2c..4a0a4439a1875aecd759a19a3191d1177761103e 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-24  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR C++/21645
+       * g++.dg/init/ctor5.C: New test.
+
 2005-05-24  Ira Rosen  <irar@il.ibm.com>
 
        * gcc.dg/vect/vect-none.c: Split into vect-106.c, vect-107.c,
diff --git a/gcc/testsuite/g++.dg/init/ctor5.C b/gcc/testsuite/g++.dg/init/ctor5.C
new file mode 100644 (file)
index 0000000..cc93318
--- /dev/null
@@ -0,0 +1,17 @@
+//  PR C++/21645
+//  We were crashing because we forgot to update the type for
+//  the cloned argument for the cloned ctor.
+
+struct color {
+  ~color();
+};
+struct style {
+  color col;
+  style (color);
+};
+
+style::style(color c)
+  : col(c)
+{
+}
+