Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice10624.d(39): Error: no operator `<` for type `Tuple`
5 fail_compilation/ice10624.d(13): perhaps overload it with `int opCmp(Tuple!(Msg) other) const {}`
6 fail_compilation/ice10624.d(49): Error: template instance `ice10624.Variant.handler!(Tuple!(Msg))` error instantiating
7 fail_compilation/ice10624.d(22): instantiated from here: `opAssign!(Tuple!(Msg))`
8 ---
9 */
10
11 struct Msg {}
12
13 struct Tuple(Specs...)
14 {
15 Specs expand;
16 alias expand this;
17 }
18
19 void main()
20 {
21 Variant data;
22 data = Tuple!Msg();
23
24 }
25
26 struct Variant
27 {
28 ptrdiff_t function() fptr = &handler!(void);
29
30 static ptrdiff_t handler(A : void)()
31 {
32 return 0;
33 }
34 static ptrdiff_t handler(A)()
35 {
36 A* zis;
37 A* rhsPA;
38 {
39 return *zis < *rhsPA ? -1 : 1;
40 // Tuple!(Msg) < Tuple!(Msg)
41 // Tuple!(Msg).expand < Tuple!(Msg).expand
42 // -> should be error
43 }
44 return 0;
45 }
46
47 Variant opAssign(T)(T rhs)
48 {
49 fptr = &handler!(T);
50 return this;
51 }
52 }