]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/88136 - -Wdeprecated-copy false positives
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Dec 2018 21:17:08 +0000 (21:17 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Dec 2018 21:17:08 +0000 (21:17 +0000)
commit482bd38ed8984aad9b1560405e7b3d775c194ccd
tree6b80e5d185cdf98f73f8ceefb770c17019adbbe1
parent1da05d55ec358993c498d044cd765ffc03664bba
PR c++/88136 - -Wdeprecated-copy false positives

Deprecating the copy operations because the class has a user-provided
destructor turns out to have too many false positives; this patch adjusts
-Wdeprecated-copy to only deprecate if the other copy operation is
user-provided.  To get the earlier behavior, people can explicitly request
it with -Wdeprecated-copy-dtor.

gcc/c-family/
* c.opt (Wdeprecated-copy-dtor): New.
(Wdeprecated-copy): Move to -Wextra.
gcc/cp/
* class.c (classtype_has_depr_implicit_copy): Rename from
classtype_has_user_copy_or_dtor.
* method.c (lazily_declare_fn): Adjust.
* decl2.c (cp_warn_deprecated_use): Refer to -Wdeprecated-copy-dtor
if deprecation is due to a destructor.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266867 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/method.c
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/cpp0x/depr-copy1.C