MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail15044.d
blob964dcf913c2af3d6a0b0044c8df23113f3eac213
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail15044.d(30): Error: generated function `fail15044.V.opAssign` cannot be used because it is annotated with `@disable`
5 ---
6 */
8 struct S
10 void opAssign(S) {}
13 struct V
15 // `s` has opAssign, so struct V needs to generate member-wise opAssign.
16 // But S.opAssign is not callable on const object, so V.opAssign should be
17 // @disable.
18 const S s;
20 // Here, the initializer of x is evaluated in V.semantic2. But
21 // V.opAssign.semantic3 is not yet invoked, so its attribute should be
22 // lazily inferred in functionSemantic even though it's non-instantiated function.
23 enum int x = ()
25 // Here, the initializer of x is evaluated in V.semantic2, and
26 // V.opAssign.semantic3 is not yet invoked in this time.
27 // Therefore its @disable attribute needs to be inferred by
28 // functionSemantic, even though it's non-instantiated function.
29 V v;
30 v = v;
31 }();