d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag_err1.d
blobd1659c401cf2597e1541e210335da6827ddd1ea9
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag_err1.d(21): Error: undefined identifier `x`
5 fail_compilation/diag_err1.d(21): while evaluating `pragma(msg, [1, 2, x].length)`
6 fail_compilation/diag_err1.d(22): Error: undefined identifier `x`
7 fail_compilation/diag_err1.d(22): Error: undefined identifier `y`
8 fail_compilation/diag_err1.d(22): while evaluating `pragma(msg, (x + y).sizeof)`
9 fail_compilation/diag_err1.d(23): Error: undefined identifier `x`
10 fail_compilation/diag_err1.d(23): while evaluating `pragma(msg, (n += x).sizeof)`
11 fail_compilation/diag_err1.d(24): Error: incompatible types for `(s) ~ (n)`: `string` and `int`
12 fail_compilation/diag_err1.d(24): while evaluating `pragma(msg, (s ~ n).sizeof)`
13 ---
16 void main()
18 int n;
19 string s;
21 pragma(msg, [1,2,x].length);
22 pragma(msg, (x + y).sizeof);
23 pragma(msg, (n += x).sizeof);
24 pragma(msg, (s ~ n).sizeof);