[Issue 1875] &null[x] compiles and runs, giving x

Lionello Lunesu lionello at lunesu.remove.com
Wed Feb 27 21:27:53 PST 2008


> also; null is a pointer. all pointers are indexable. -> null is indexable*

Apparently they are, but should they be?

void main()
{
  void* va;
  auto x = &va[2];
}

This compiles just fine (2.011) but should indexing a void* (and therefor: 
null) even be allowed?

L. 



More information about the Digitalmars-d-bugs mailing list