c++ access static members using null pointer
TL;DR: Your example is well-defined. Merely dereferencing a null pointer is not invoking UB. There is a lot of debate over this topic, which basically boils down to whether indirection through a null pointer is itself UB. The only questionable thing that happens in your example is the evaluation of the object expression. In particular, … Read more