Debian Codegraph @

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

raw
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/test11006.d(11): Error: cannot subtract pointers to different types: `void*` and `int*`.
4 fail_compilation/test11006.d(11): while evaluating: `static assert(cast(void*)8 - cast(int*)0 == 2L)`
5 fail_compilation/test11006.d(12): Error: cannot subtract pointers to different types: `int*` and `void*`.
6 fail_compilation/test11006.d(12): while evaluating: `static assert(cast(int*)8 - cast(void*)0 == 8L)`
7 fail_compilation/test11006.d(13): Error: cannot subtract pointers to different types: `ushort*` and `ubyte*`.
8 fail_compilation/test11006.d(13): while evaluating: `static assert(null - null == 0)`
9 ---
10 */
11 static assert(cast(void*)8 - cast(int*) 0 == 2L);
12 static assert(cast(int*) 8 - cast(void*)0 == 8L);
13 static assert((ushort*).init - (ubyte*).init == 0);