Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice1144.d(14): Error: undefined identifier `a`
5 fail_compilation/ice1144.d(23): Error: template instance `ice1144.testHelper!("hello", "world")` error instantiating
6 ---
7 */
8
9 // https://issues.dlang.org/show_bug.cgi?id=1144
10 // ICE(template.c) template mixin causes DMD crash
11 char[] testHelper(A ...)()
12 {
13 char[] result;
14 foreach (t; a)
15 {
16 result ~= "int " ~ t ~ ";\n";
17 }
18 return result;
19 }
20
21 void main()
22 {
23 mixin(testHelper!("hello", "world")());
24 }