d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag9620.d
blob4af87df0a2f745cce823adf7586879d03729c506
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag9620.d(20): Error: `pure` function `diag9620.main.bar` cannot call impure function `diag9620.foo1`
5 fail_compilation/diag9620.d(21): Error: `pure` function `diag9620.main.bar` cannot call impure function `diag9620.foo2!().foo2`
6 fail_compilation/diag9620.d(14): which wasn't inferred `pure` because of:
7 fail_compilation/diag9620.d(14): `pure` function `diag9620.foo2!().foo2` cannot access mutable static data `x`
8 ---
9 */
11 int x;
13 void foo1() { x = 3; }
14 void foo2()() { x = 3; }
16 void main() pure
18 void bar()
20 foo1();
21 foo2();