summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail9346.d
blob: 57d420f76ef524c88c74e84dc59546b20c751f50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
TEST_OUTPUT:
---
fail_compilation/fail9346.d(26): Error: struct fail9346.S is not copyable because it is annotated with `@disable`
fail_compilation/fail9346.d(27): Error: struct fail9346.S is not copyable because it is annotated with `@disable`
---
*/

struct S
{
    @disable this(this);
}
struct SS1
{
    S s;
}
struct SS2
{
    S s;
    this(this){}
}

void main()
{
    S s;
    SS1 ss1 = SS1(s);
    SS2 ss2 = SS2(s);
}