Is there any section in the C++ standard the shows that NULL references are ill-formed? I am trying to show my lecturer (this is for an assignment for which I am being graded) that the following expression is undefined behaviour:
AClass* ptr = 0;
AClass& ali = *ptr;
std::cout << "\n" << (AClass*) &ali << '\n';
The violations I see, is dereferencing of a null pointer, and then referencing a null reference. In an a program he is using as a correct example, he is comparing the return of the dereferenced pointer reference:
(AClass*) &ali != (AClass*) 0
As a test for an objects validity. I saw this as completely undefined behavior; I want to find a quote from the standard that is a bit more concrete for my explanation.
If I'm wrong, then please show where I have made an error.