Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag15974.d(21): Error: variable `f` cannot be read at compile time
5 fail_compilation/diag15974.d(21): called from here: `format("%s", f)`
6 fail_compilation/diag15974.d(26): Error: variable `f` cannot be read at compile time
7 fail_compilation/diag15974.d(26): called from here: `format("%s", f)`
8 ---
9 */
10
11 void test15974()
12 {
13 string format(Args...)(string fmt, Args args)
14 {
15 return "";
16 }
17
18 string f = "vkCreateSampler";
19
20 // CompileStatement
21 mixin(format("%s", f));
22
23 struct S
24 {
25 // CompileDeclaration
26 mixin(format("%s", f));
27 }
28 }