N3778: Sized Deallocation
commitd1856d2c87b844afb0e31f7aa9502745b3446189
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Dec 2014 18:31:40 +0000 (15 18:31 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Dec 2014 18:31:40 +0000 (15 18:31 +0000)
tree7d781cbe68124e8fc1d4fd6541d6318c1962a1be
parent6334270bd15a644a20976bc0813650a84d273534
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218755 138bc75d-0d04-0410-961f-82ee72b054a4
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]