aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/ctor5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/init/ctor5.C')
-rw-r--r--gcc/testsuite/g++.dg/init/ctor5.C17
1 files changed, 17 insertions, 0 deletions
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)
+{
+}
+