gcc/testsuite/gdc.test/fail_compilation/safer.d
raw| 1 | /* REQUIRED_ARGS: -preview=safer |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/safer.d(10): Error: `void` initializing a pointer is not allowed in a function with default safety with `-preview=safer` |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | void test1() |
| 9 | { |
| 10 | int* p = void; |
| 11 | } |
| 12 | |
| 13 | void foo3() { } |
| 14 | |
| 15 | void test2() |
| 16 | { |
| 17 | foo3(); // should not be an error |
| 18 | } |