File tree 2 files changed +23
-4
lines changed
2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 4423
4423
signature.
4424
4424
4425
4425
\pnum
4426
- If a deallocation function terminates by throwing an exception, the behavior is undefined.\ubxref {basic.stc.alloc.dealloc.constraint.2 }
4426
+ If a deallocation function terminates by throwing an exception, the behavior is undefined.\ubxref {basic.stc.alloc.dealloc.throw }
4427
4427
The value of the first argument supplied to a deallocation function may
4428
4428
be a null pointer value; if so, and if the deallocation function is one
4429
4429
supplied in the standard library, the call has no effect.
Original file line number Diff line number Diff line change 262
262
263
263
\pnum
264
264
\ubxref {basic.stc.alloc.dealloc.constraint } \\
265
- % \ubxref{basic.stc.alloc.dealloc.constraint.2} \\
266
265
If the behavior of an allocation or deallocation function does not satisfy the semantic constraints
267
266
specified
268
- in \iref {basic.stc.dynamic.allocation } and \iref {basic.stc.dynamic.deallocation },
269
- including exiting via a thrown exception when not specified to do so,
267
+ in \iref {basic.stc.dynamic.allocation } and \iref {basic.stc.dynamic.deallocation }.
270
268
the behavior is undefined.
271
269
272
270
287
285
\end {codeblock }
288
286
\end {example }
289
287
288
+ \pnum
289
+ \ubxref {basic.stc.alloc.dealloc.throw } \\
290
+ If a call to a deallocation function
291
+ terminates by throwing an exception
292
+ the behavior is undefined.
293
+ \pnum
294
+ \begin {example }
295
+ \begin {codeblock }
296
+ struct X {
297
+ void operator delete(void*) { throw "oops" ; }
298
+ };
299
+ void f()
300
+ {
301
+ X* x = new X();
302
+ delete x; // undefined behavior
303
+ }
304
+ \end {codeblock }
305
+ \end {example }
306
+
307
+
308
+
290
309
\rSec 2[ub.basic.stc.alloc.zero.dereference]{Zero-sized allocation dereference}
291
310
292
311
\pnum
You can’t perform that action at this time.
0 commit comments