PR c++/58407 - deprecated implicit copy ops.
authorJason Merrill <jason@redhat.com>
Fri, 18 May 2018 20:02:48 +0000 (16:02 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 18 May 2018 20:02:48 +0000 (16:02 -0400)
commitb46b715d5b838d9869f89d3594ebf7d0b7cb374c
tree5684d331d1a9d9e995bb252f9febf8e86618a0a5
parentf07c22376848e9923aa8455d2c0a059d9d0e01d5
PR c++/58407 - deprecated implicit copy ops.

gcc/c-family/
* c.opt (Wdeprecated-copy): New flag.
gcc/cp/
* call.c (build_over_call): Warn about deprecated trivial fns.
* class.c (classtype_has_user_copy_or_dtor): New.
(type_build_ctor_call): Check TREE_DEPRECATED.
(type_build_dtor_call): Likewise.
* decl2.c (cp_warn_deprecated_use): Move from tree.c.
Add checks.  Return bool.  Handle -Wdeprecated-copy.
(mark_used): Use it.
* decl.c (grokdeclarator): Remove redundant checks.
* typeck2.c (build_functional_cast): Likewise.
* method.c (lazily_declare_fn): Mark deprecated copy ops.
* init.c (build_aggr_init): Only set TREE_USED if there are
side-effects.
libitm/
* beginend.cc (save): Disable -Werror=deprecated-copy.

From-SVN: r260381
17 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/init.c
gcc/cp/method.c
gcc/cp/tree.c
gcc/cp/typeck2.c
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/cpp0x/depr-copy1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/warn6.C
libitm/ChangeLog
libitm/beginend.cc