Debian Codegraph @

gcc/testsuite/gdc.test/compilable/issue22854.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=22854
2 void test22854()
3 {
4 static foreach (ch; SomeContainer().range) { }
5 }
6
7 struct SomeContainer
8 {
9 SomeRange range() { return SomeRange(); }
10 TypeWithDestructor data;
11 }
12
13 struct TypeWithDestructor { ~this() { } }
14
15 struct SomeRange
16 {
17 int front() { return 0; }
18 bool empty() { return true; }
19 void popFront() { }
20 }