mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
11 lines
276 B
Text
11 lines
276 B
Text
An error is now given for subtracting pointers of different types
|
|
|
|
The following code now gives errors:
|
|
```
|
|
static assert(cast(void*)8 - cast(int*) 0 == 2L);
|
|
static assert(cast(int*) 8 - cast(void*)0 == 8L);
|
|
void test()
|
|
{
|
|
auto foo = (ushort*).init - (ubyte*).init;
|
|
}
|
|
```
|