diff options
author | Jason Merrill <jason@redhat.com> | 2014-12-15 13:31:40 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-12-15 13:31:40 -0500 |
commit | 20b06addf9bfe928559f3bccca9e70485eec7c02 (patch) | |
tree | 7d781cbe68124e8fc1d4fd6541d6318c1962a1be /gcc/c-family/c-opts.c | |
parent | 14fa3e7fdf48c8b9529573356964a7d0e1426863 (diff) | |
download | gcc-20b06addf9bfe928559f3bccca9e70485eec7c02.zip gcc-20b06addf9bfe928559f3bccca9e70485eec7c02.tar.gz gcc-20b06addf9bfe928559f3bccca9e70485eec7c02.tar.bz2 |
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
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r-- | gcc/c-family/c-opts.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 08a36f0..dbb9912 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -889,6 +889,10 @@ c_common_post_options (const char **pfilename) else if (warn_narrowing == -1) warn_narrowing = 0; + /* Global sized deallocation is new in C++14. */ + if (flag_sized_deallocation == -1) + flag_sized_deallocation = (cxx_dialect >= cxx14); + if (flag_extern_tls_init) { #if !defined (ASM_OUTPUT_DEF) || !SUPPORTS_WEAK |