summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test20842.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/test20842.d')
-rw-r--r--gcc/testsuite/gdc.test/compilable/test20842.d33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/test20842.d b/gcc/testsuite/gdc.test/compilable/test20842.d
new file mode 100644
index 00000000000..86049e6db48
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test20842.d
@@ -0,0 +1,33 @@
+// https://issues.dlang.org/show_bug.cgi?id=20842
+
+struct A
+{
+ int i;
+ @disable this(ref A);
+}
+
+A a = { i: 123 };
+
+struct B
+{
+ int i;
+ @disable this();
+}
+
+B b = { i: 123 };
+
+union C
+{
+ int i;
+ @disable this(ref C);
+}
+
+C c = { i: 123 };
+
+union D
+{
+ int i;
+ @disable this();
+}
+
+D d = { i: 123 };