There are no virtual functions, so there is no check of the vtable. Because of this, it just calls a function based on the static type. Since the function doesn't use the this pointer, no undefined behavior occurs nothing bad happens.
In other words, the implementation doesn't check the pointer, so it is never even noticed that it is null. The behavior is still undefined.
Since the function doesn't use the this pointer, no undefined behavior occurs.
There was discussion on this before. I use to have this stance but was proven wrong.
If you're using ->, you are dereferencing a pointer. Dereferencing a null pointer is undefined behavior. As far as the standard is concerned, it's that cut-and-dry.
Though from a practical standpoint, you are right. The compiler does not need to actually dereference 'this' which is why it's not crashing for him. But there is no guarantee that will always be the case.
I never said it wasn't undefined - I guess what I meant was 'nothing bad happened' rather than 'no undefined behavior occurred'. You're right, the behavior is undefined and I used the wrong words.