N3778: Sized Deallocation
authorJason Merrill <jason@redhat.com>
Mon, 15 Dec 2014 18:31:40 +0000 (13:31 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 15 Dec 2014 18:31:40 +0000 (13:31 -0500)
commit20b06addf9bfe928559f3bccca9e70485eec7c02
tree7d781cbe68124e8fc1d4fd6541d6318c1962a1be
parent14fa3e7fdf48c8b9529573356964a7d0e1426863
N3778: Sized Deallocation

N3778: Sized Deallocation
gcc/c-family/
* c.opt (-fsized-deallocation, -Wc++14-compat): New.
(-Wsized-deallocation): New.
* c-opts.c (c_common_post_options): -fsized-deallocation defaults
to on in C++14 and up.
gcc/cp/
* call.c (non_placement_deallocation_fn_p): A global sized
operator delete is not a usual deallocation function until C++14.
(build_op_delete_call): Choose the global sized op delete if we
know the size.
* cp-tree.h: Declare non_placement_deallocation_fn_p.
(enum cp_tree_index): Remove CPTI_GLOBAL_DELETE_FNDECL.
(global_delete_fndecl): Remove.
* decl.c (cxx_init_decl_processing): Also declare sized op deletes.
(grok_op_properties): Warn about sized dealloc without the flag.
* init.c (build_builtin_delete_call): Remove.
(build_vec_delete_1, build_delete): Don't call it.
* decl2.c (maybe_warn_sized_delete): New.
(cp_write_global_declarations): Call it.
libstdc++-v3/
* libsupc++/del_ops.cc: New.
* libsupc++/del_opvs.cc: New.
* libsupc++/Makefile.am: Add them.
* libsupc++/Makefile.in: Regenerate.
* config/abi/pre/gnu.ver: Export _ZdlPvm and _ZdaPvm.

From-SVN: r218755
20 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/c-family/c.opt
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/doc/invoke.texi
gcc/testsuite/g++.dg/cpp1y/sized-dealloc1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/sized-dealloc2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/sized-dealloc3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tree-ssa/pr61034.C
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/libsupc++/Makefile.am
libstdc++-v3/libsupc++/Makefile.in
libstdc++-v3/libsupc++/del_ops.cc [new file with mode: 0644]
libstdc++-v3/libsupc++/del_opvs.cc [new file with mode: 0644]