diff options
author | Jason Merrill <jason@redhat.com> | 2018-11-12 23:40:01 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-11-12 23:40:01 -0500 |
commit | a6bb6b07f76c4431cb5a2a520ac33f7c970b80c1 (patch) | |
tree | 4da8d10f970dd37ab850c548d36cd4980e9a623d /gcc/c-family/c-cppbuiltin.c | |
parent | 7de37c97b4031ba61c867cf6fadf63916c666894 (diff) | |
download | gcc-a6bb6b07f76c4431cb5a2a520ac33f7c970b80c1.zip gcc-a6bb6b07f76c4431cb5a2a520ac33f7c970b80c1.tar.gz gcc-a6bb6b07f76c4431cb5a2a520ac33f7c970b80c1.tar.bz2 |
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.
From-SVN: r266053
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 8dd6215..7daa3e3 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -980,6 +980,7 @@ c_cpp_builtins (cpp_reader *pfile) /* Set feature test macros for C++2a. */ cpp_define (pfile, "__cpp_conditional_explicit=201806"); cpp_define (pfile, "__cpp_nontype_template_parameter_class=201806"); + cpp_define (pfile, "__cpp_impl_destroying_delete=201806"); } if (flag_concepts) cpp_define (pfile, "__cpp_concepts=201507"); |