4 fail_compilation/attributediagnostic_nogc.d(21): Error: `@nogc` function `attributediagnostic_nogc.layer2` cannot call non-@nogc function `attributediagnostic_nogc.layer1`
5 fail_compilation/attributediagnostic_nogc.d(22): which calls `attributediagnostic_nogc.layer0`
6 fail_compilation/attributediagnostic_nogc.d(23): which calls `attributediagnostic_nogc.gc`
7 fail_compilation/attributediagnostic_nogc.d(27): which wasn't inferred `@nogc` because of:
8 fail_compilation/attributediagnostic_nogc.d(27): `asm` statement in function `attributediagnostic_nogc.gc` is assumed to use the GC - mark it with `@nogc` if it does not
9 fail_compilation/attributediagnostic_nogc.d(43): Error: `@nogc` function `D main` cannot call non-@nogc function `attributediagnostic_nogc.gc1`
10 fail_compilation/attributediagnostic_nogc.d(32): which wasn't inferred `@nogc` because of:
11 fail_compilation/attributediagnostic_nogc.d(32): cannot use `new` in `@nogc` function `attributediagnostic_nogc.gc1`
12 fail_compilation/attributediagnostic_nogc.d(44): Error: `@nogc` function `D main` cannot call non-@nogc function `attributediagnostic_nogc.gc2`
13 fail_compilation/attributediagnostic_nogc.d(38): which wasn't inferred `@nogc` because of:
14 fail_compilation/attributediagnostic_nogc.d(38): `@nogc` function `attributediagnostic_nogc.gc2` cannot call non-@nogc `fgc`
15 fail_compilation/attributediagnostic_nogc.d(45): Error: `@nogc` function `D main` cannot call non-@nogc function `attributediagnostic_nogc.gcClosure`
16 fail_compilation/attributediagnostic_nogc.d(48): which wasn't inferred `@nogc` because of:
17 fail_compilation/attributediagnostic_nogc.d(48): function `attributediagnostic_nogc.gcClosure` is `@nogc` yet allocates closure for `gcClosure()` with the GC
21 // Issue 17374 - Improve inferred attribute error message
22 // https://issues.dlang.org/show_bug.cgi?id=17374
24 auto layer2() @nogc { layer1(); }
25 auto layer1() { layer0(); }
26 auto layer0() { gc(); }
38 auto fgc
= function void() {new int[10];};
54 int bar() { return x
; }