Debian Codegraph @

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

raw
1 // REQUIRED_ARGS: -m64
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail238_m64.d(21): Error: cannot implicitly convert expression `"a"` of type `string` to `ulong`
6 fail_compilation/fail238_m64.d(24): Error: cannot implicitly convert expression `X!()` of type `void` to `const(string)`
7 fail_compilation/fail238_m64.d(29): Error: template instance `fail238_m64.A!"a"` error instantiating
8 fail_compilation/fail238_m64.d(35): instantiated from here: `M!(q)`
9 fail_compilation/fail238_m64.d(35): while evaluating `pragma(msg, M!(q))`
10 ---
11 */
12
13 // https://issues.dlang.org/show_bug.cgi?id=581
14 // Error message w/o line number in dot-instantiated template
15 template X(){}
16
17 template D(string str){}
18
19 template A(string str)
20 {
21 static if (D!(str[str]))
22 {}
23 else
24 const string A = .X!();
25 }
26
27 template M(alias B)
28 {
29 const string M = A!("a");
30 }
31
32 void main()
33 {
34 int q = 3;
35 pragma(msg, M!(q));
36 }