Debian Codegraph @

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

raw
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 ---
14 */
15
16 void main()
17 {
18 int n;
19 string s;
20
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);
25 }