diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail23036.d')
-rw-r--r-- | gcc/testsuite/gdc.test/fail_compilation/fail23036.d | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail23036.d b/gcc/testsuite/gdc.test/fail_compilation/fail23036.d new file mode 100644 index 00000000000..8920586c67a --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/fail23036.d @@ -0,0 +1,22 @@ +// https://issues.dlang.org/show_bug.cgi?id=23036 + +/* +TEST_OUTPUT: +--- +fail_compilation/fail23036.d(12): Error: `struct S` may not define both a rvalue constructor and a copy constructor +fail_compilation/fail23036.d(15): rvalue constructor defined here +fail_compilation/fail23036.d(14): copy constructor defined here +--- +*/ + +struct S +{ + this(ref S) {} + this(S, int a = 2) {} +} + +void main() +{ + S a; + S b = a; +} |