Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/constraints_aggr.d

raw
1 /*
2 EXTRA_FILES: imports/constraints.d
3 TEST_OUTPUT:
4 ---
5 fail_compilation/constraints_aggr.d(32): Error: template `f` is not callable using argument types `!()(int)`
6 fail_compilation/imports/constraints.d(60): Candidate is: `f(T)(T v)`
7 with `T = int`
8 must satisfy the following constraint:
9 ` !P!T`
10 fail_compilation/constraints_aggr.d(33): Error: template `g` is not callable using argument types `!()()`
11 fail_compilation/imports/constraints.d(63): Candidate is: `g(this T)()`
12 with `T = imports.constraints.C`
13 must satisfy the following constraint:
14 ` N!T`
15 fail_compilation/constraints_aggr.d(35): Error: template instance `imports.constraints.S!int` does not match template declaration `S(T)`
16 with `T = int`
17 must satisfy the following constraint:
18 ` N!T`
19 fail_compilation/constraints_aggr.d(44): Error: template instance `imports.constraints.BitFlags!(Enum)` does not match template declaration `BitFlags(E, bool unsafe = false)`
20 with `E = Enum`
21 must satisfy one of the following constraints:
22 ` unsafe
23 N!E`
24 ---
25 */
26
27 void main()
28 {
29 import imports.constraints;
30
31 C c = new C;
32 c.f(0);
33 c.g();
34
35 S!int;
36
37 enum Enum
38 {
39 A = 1,
40 B = 2,
41 C = 4,
42 BC = B|C
43 }
44 BitFlags!Enum flags;
45 }