diff options
author | Jason Merrill <jason@redhat.com> | 2018-12-06 16:17:08 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-12-06 16:17:08 -0500 |
commit | 5c8b3702e36a8792fa297f6b2b2cc865e08bb1b7 (patch) | |
tree | 6b80e5d185cdf98f73f8ceefb770c17019adbbe1 /gcc/cp/method.c | |
parent | 6e00bd6eb238f106101e32ce5c76b4b3ab8e26cc (diff) | |
download | gcc-5c8b3702e36a8792fa297f6b2b2cc865e08bb1b7.zip gcc-5c8b3702e36a8792fa297f6b2b2cc865e08bb1b7.tar.gz gcc-5c8b3702e36a8792fa297f6b2b2cc865e08bb1b7.tar.bz2 |
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.
From-SVN: r266867
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 936dad4..fd023e2 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -2380,7 +2380,7 @@ lazily_declare_fn (special_function_kind sfk, tree type) { if (classtype_has_move_assign_or_move_ctor_p (type, true)) DECL_DELETED_FN (fn) = true; - else if (classtype_has_user_copy_or_dtor (type)) + else if (classtype_has_depr_implicit_copy (type)) /* The implicit definition of a copy constructor as defaulted is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor. The implicit definition of a copy |