gcc/testsuite/gdc.test/compilable/test20201.d
raw| 1 | /* REQUIRED_ARGS: -betterC |
| 2 | */ |
| 3 | |
| 4 | // https://issues.dlang.org/show_bug.cgi?id=20101 |
| 5 | |
| 6 | public string ctfeHelper()(string a) |
| 7 | { |
| 8 | return "int " ~ a ~ " = 42;"; |
| 9 | } |
| 10 | |
| 11 | extern(C) int main() |
| 12 | { |
| 13 | int b = __traits(compiles, ctfeHelper("a")); |
| 14 | mixin(ctfeHelper("a")); |
| 15 | return !(a + b); |
| 16 | } |