diff --git a/source/compatibility.tex b/source/compatibility.tex index 77b08b1d8e..fd90a29804 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -33,6 +33,26 @@ \end{codeblock} \end{example} +\diffref{expr.delete} +\change +Calling \tcode{delete} on a pointer to an incomplete class is ill-formed. +\rationale +Reduce undefined behavior. +\effect +A valid \CppXXIII{} program that that calls \tcode{delete} on an incomplete +class type is ill-formed. +\begin{example} +\begin{codeblock} +struct S; + +void f(S *p) { + delete p; // ill-formed; previously well-formed +} + +struct S {}; +\end{codeblock} +\end{example} + \rSec2[diff.cpp23.dcl.dcl]{\ref{dcl.dcl}: Declarations} \diffref{dcl.init.list} diff --git a/source/expressions.tex b/source/expressions.tex index 91090a385c..ba0cd3f76d 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5853,9 +5853,8 @@ \pnum \indextext{type!incomplete}% -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. +If the object being deleted has incomplete class type at the point of deletion, +the program is ill-formed. \pnum \indextext{\idxcode{delete}!destructor and}%