gcc/testsuite/gdc.test/fail_compilation/safe_gshared.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/safe_gshared.d(13): Error: accessing `__gshared` data `x` is not allowed in a `@safe` function |
| 5 | fail_compilation/safe_gshared.d(14): Error: accessing `__gshared` data `x` is not allowed in a `@safe` function |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | __gshared int x; |
| 10 | |
| 11 | @safe int f() |
| 12 | { |
| 13 | x++; |
| 14 | return x; |
| 15 | } |