diff options
author | Jason Merrill <jason@redhat.com> | 2020-07-12 17:31:24 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-07-20 18:18:12 -0400 |
commit | e443d8213864ac337c29092d4767224f280d2062 (patch) | |
tree | 1ae6feb7361f7274835f0e8051befab2a5a83f79 /gcc/memmodel.h | |
parent | 812798917c59e95405a71b31ab37bd78c0f43f79 (diff) | |
download | gcc-e443d8213864ac337c29092d4767224f280d2062.zip gcc-e443d8213864ac337c29092d4767224f280d2062.tar.gz gcc-e443d8213864ac337c29092d4767224f280d2062.tar.bz2 |
c++: Pseudo-destructor ends object lifetime.
P0593R6 is mostly about a new object model whereby malloc and the like are
treated as implicitly starting the lifetime of whatever trivial types are
necessary to give the program well-defined semantics; that seems only
relevant to TBAA, and is not implemented here.
The paper also specifies that a pseudo-destructor call (a destructor call
for a non-class type) ends the lifetime of the object like a destructor call
for an object of class type, even though it doesn't call a destructor; this
patch implements that change.
The paper was voted as a DR, so I'm applying this change to all standard
levels. Like class end-of-life clobbers, it is controlled by
-flifetime-dse.
gcc/cp/ChangeLog:
* pt.c (type_dependent_expression_p): A pseudo-dtor can be
dependent.
* semantics.c (finish_call_expr): Use build_trivial_dtor_call for
pseudo-destructor.
(finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
gcc/testsuite/ChangeLog:
* g++.dg/opt/flifetime-dse7.C: New test.
Diffstat (limited to 'gcc/memmodel.h')
0 files changed, 0 insertions, 0 deletions