1 // Test that we can refer to the address of a base member of a null pointer
2 // to get its offset. The standard says that offsetof shall not be used on
3 // non-POD classes, but there seems to be no such restriction on the common
4 // implementation thereof.
6 // Yes, this is bad, naughty, evil code. But it seems to be well-formed.
17 struct C: public B { };
21 return ((unsigned long) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" }