Why is the deletion of an incomplete type defined as "undefined behaviour"?
From the C++ specification; §5.3.5/5;
If the object being deleted has incomplete class type at the point of deletion and the complete class has a non-trivial destructor or a deallocation function, the behavior is undefined.
Given the code example (I understand why it is an error);
class ABC;
int main()
{
ABC* p = nullptr;
delete p;
}
Why is it defined as being undefined behaviour when gcc, clang and msvc all warn on it being an incomplete type? Why not just error at that point, i.e. why is it not a diagnosable error?