summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-24 19:06:20 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-24 19:06:20 +0000
commit39908afabfddaf12cc4c31cea6a64abe75cf474f (patch)
treee3529a5f8707e1b6aefed4933ca3d3ef37b21050
parentfcd2418b07cdd4737eeea874b53e4b2cb92275b1 (diff)
downloadppe42-gcc-39908afabfddaf12cc4c31cea6a64abe75cf474f.tar.gz
ppe42-gcc-39908afabfddaf12cc4c31cea6a64abe75cf474f.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100106 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/optimize.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/init/ctor5.C17
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 91a41c3408f..f15e1e92a3c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 7ccfaffbf0d..bf9b22b63e9 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b742080db94..4a0a4439a18 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..cc933188201
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ctor5.C
@@ -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)
+{
+}
+
OpenPOWER on IntegriCloud