Does not evaluating the expression to which sizeof is applied make it legal to dereference a null or invalid pointer inside sizeof in C++?
I believe this is currently underspecified in the standard, like many issues such as What is the value category of the operands of C++ operators when unspecified?. I don’t think it was intentional, like hvd points outs it is probably obvious to the committee. In this specific case I think we have the evidence to … Read more