]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/test17451.d
fc2f2d22c769db92ca353115dd4cc92797933a1a
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test17451.d
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/test17451.d(22): Error: undefined identifier `allocator`
4 fail_compilation/test17451.d(23): Error: `long` has no effect in expression `false`
5 fail_compilation/test17451.d(30): Error: variable test17451.HashMap!(ThreadSlot).HashMap.__lambda2.v size of type ThreadSlot is invalid
6 fail_compilation/test17451.d(44): Error: template instance test17451.HashMap!(ThreadSlot) error instantiating
7 ---
8 */
9
10 // https://issues.dlang.org/show_bug.cgi?id=17451
11
12 interface ManualEvent {}
13
14 interface EventDriver {
15 ManualEvent createManualEvent() ;
16 }
17
18 struct ArraySet(Key)
19 {
20 ~this()
21 {
22 try allocator;
23 catch false; // should never happen
24 }
25 }
26
27 struct HashMap(TValue)
28 {
29 alias Value = TValue;
30 static if ({ Value v; }) {}
31 }
32
33 struct Task {}
34
35 class Libevent2Driver : EventDriver {
36 Libevent2ManualEvent createManualEvent() {}
37 }
38
39 struct ThreadSlot {
40 ArraySet!Task tasks;
41 }
42
43 class Libevent2ManualEvent {
44 HashMap!ThreadSlot m_waiters;
45 }