Debian Codegraph @

gcc/testsuite/gdc.dg/pr96254a.d

raw
1 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96254
2 // { dg-do compile }
3 struct map(alias fun)
4 {
5 @property run()
6 {
7 }
8 }
9
10 struct Task(Args)
11 {
12 Args _args;
13 }
14
15 template reduce(functions...)
16 {
17 auto reduce(Args)(Args args)
18 {
19 alias RTask = Task!(typeof(args));
20 auto task = RTask();
21 }
22 }
23
24 void main() // { dg-error "'D main' is a nested function and cannot be accessed" }
25 {
26 immutable delta = 1;
27 reduce!"a + b"(map!({ immutable x = delta; })());
28 }