summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail23036.d
blob: 8920586c67a8a4ff0ce1def51727d0288d30c7f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}