Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/attributediagnostic_pure.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/attributediagnostic_pure.d(19): Error: `pure` function `D main` cannot call impure function `attributediagnostic_pure.gc`
5 fail_compilation/attributediagnostic_pure.d(14): and executing an `asm` statement without `pure` annotation makes it fail to infer `pure`
6 ---
7 */
8
9 // Issue 17374 - Improve inferred attribute error message
10 // https://issues.dlang.org/show_bug.cgi?id=17374
11
12 auto gc()
13 {
14 asm {}
15 }
16
17 void main() pure
18 {
19 gc();
20 }