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