Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag15713.d(20): Error: no property `widthSign` for `this` of type `diag15713.WrData.Data`
5 fail_compilation/diag15713.d(16): struct `Data` defined here
6 fail_compilation/diag15713.d(40): Error: template instance `diag15713.conwritefImpl!("parse-int", "width", "\n", Data(null))` error instantiating
7 fail_compilation/diag15713.d(45): instantiated from here: `conwritefImpl!("main", "\n", Data(null))`
8 fail_compilation/diag15713.d(50): instantiated from here: `fdwritef!()`
9 ---
10 */
11
12 void wrWriteWidthChar() {}
13
14 auto WrData(int , int )
15 {
16 struct Data
17 {
18 auto initInt(string name)()
19 {
20 __traits(getMember, this, name ~ "Sign");
21 }
22 }
23 return Data();
24 }
25
26 template conwritefImpl(string state, string field, string fmt, alias data, AA...)
27 if (state == "parse-int")
28 {
29 enum conwritefImpl = data.initInt!field;
30 }
31
32 template baz(string state, string fmt, alias data, AA...) {}
33 template bar(string state, string fmt, alias data, AA...) {}
34
35 enum a = "parse-format";
36
37 template conwritefImpl(string state, string fmt, alias data, AA...)
38 if (state == "main")
39 {
40 enum conwritefImpl = conwritefImpl!("parse-int", "width", fmt, data);
41 }
42
43 void fdwritef()()
44 {
45 conwritefImpl!("main", "\n", WrData(0, 0));
46 }
47
48 void conwriteln()
49 {
50 fdwritef();
51 }