File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 33
33
\end {codeblock }
34
34
\end {example }
35
35
36
+
37
+
38
+ \diffref {expr.delete }
39
+ \change
40
+ Calling \tcode {delete} on a pointer to an incomplete class is ill-formed.
41
+ \rationale
42
+ Reduce undefined behavior.
43
+ \effect
44
+ A valid \CppXXIII {} program that that calls \tcode {delete} on an incomplete
45
+ class type becomes ill-formed.
46
+ \begin {example }
47
+ \begin {codeblock }
48
+ struct S;
49
+
50
+ void f(S *p) {
51
+ delete p; // valid in \CppXXIII {}, ill-formed in this document
52
+ }
53
+
54
+ struct S {};
55
+ \end {codeblock }
56
+ \end {example }
57
+
58
+
36
59
\rSec 2[diff.cpp23.dcl.dcl]{\ref {dcl.dcl }: Declarations}
37
60
38
61
\diffref {dcl.init.list }
Original file line number Diff line number Diff line change 5839
5839
5840
5840
\pnum
5841
5841
\indextext {type!incomplete}%
5842
- If the object being deleted has incomplete class type at the point of
5843
- deletion and the complete class has a non-trivial destructor or a
5844
- deallocation function, the behavior is undefined.
5842
+ If the object being deleted has incomplete class type at the point of deletion,
5843
+ the program is ill-formed.
5845
5844
5846
5845
\pnum
5847
5846
\indextext {\idxcode {delete}!destructor and}%
You can’t perform that action at this time.
0 commit comments