]> git.ipfire.org Git - thirdparty/gcc.git/commit
Implement P0722R3, destroying operator delete.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Nov 2018 04:40:01 +0000 (04:40 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Nov 2018 04:40:01 +0000 (04:40 +0000)
commit76b94d4ba654e9af1882865933343d11f5c3b18b
tree4da8d10f970dd37ab850c548d36cd4980e9a623d
parente771eb36d40e1ad0345fa990cfe83405439e6159
Implement P0722R3, destroying operator delete.

A destroying operator delete takes responsibility for calling the destructor
for the object it is deleting; this is intended to be useful for sized
delete of a class allocated with a trailing buffer, where the compiler can't
know the size of the allocation, and so would pass the wrong size to the
non-destroying sized operator delete.

gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Define
__cpp_impl_destroying_delete.
gcc/cp/
* call.c (std_destroying_delete_t_p, destroying_delete_p): New.
(aligned_deallocation_fn_p, usual_deallocation_fn_p): Use
destroying_delete_p.
(build_op_delete_call): Handle destroying delete.
* decl2.c (coerce_delete_type): Handle destroying delete.
* init.c (build_delete): Don't call dtor with destroying delete.
* optimize.c (build_delete_destructor_body): Likewise.
libstdc++-v3/
* libsupc++/new (std::destroying_delete_t): New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266053 138bc75d-0d04-0410-961f-82ee72b054a4
13 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/init.c
gcc/cp/optimize.c
gcc/testsuite/g++.dg/cpp2a/destroying-delete1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/new