From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45354 invoked by alias); 12 Dec 2018 14:52:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 45338 invoked by uid 89); 12 Dec 2018 14:52:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=releases, Private, ville, Ville X-HELO: mail-oi1-f174.google.com Received: from mail-oi1-f174.google.com (HELO mail-oi1-f174.google.com) (209.85.167.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Dec 2018 14:52:50 +0000 Received: by mail-oi1-f174.google.com with SMTP id i6so15225298oia.6 for ; Wed, 12 Dec 2018 06:52:50 -0800 (PST) MIME-Version: 1.0 References: <20181208165817.GU12380@tucnak> In-Reply-To: From: Jason Merrill Date: Wed, 12 Dec 2018 14:52:00 -0000 Message-ID: Subject: Re: C++ PATCH for c++/88136, -Wdeprecated-copy too noisy To: Ville Voutilainen Cc: Jakub Jelinek , gcc-patches List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00820.txt.bz2 On Sat, Dec 8, 2018 at 1:33 PM Ville Voutilainen wrote: > On Sat, 8 Dec 2018 at 20:05, Ville Voutilainen > wrote: > > > > New compiler releases will usually include new warnings that require > > > some code modification to accommodate. Why is this one particularly > > > problematic? > > > > I don't think it's any more problematic than any other warning that > > introduces new errors for fools that build with -Wall and -Werror. > > But considering that those errors are false positives, and that > > turning them off will in some cases require writing boiler-plate > > (defaulted assignments), I would merely prefer having another release > > round to get fixes for my codebase out in the wild. > > For what it's worth, I find it unfortunate that this deprecation and its resulting warnings end up > making the decision on whether a "rule of 5" must be followed; correct code needs to be adjusted > to cope with a fairly stylistic matter, with false positives and all. I don't see it as a stylistic matter. If you need a user-provided copy constructor to get proper copy semantics for a class, you almost certainly need the same thing for copy assignment. This was too noisy for destructors, for which it's fairly common to define a virtual destructor just to make a class polymorphic, not because there are significant destruction semantics. But I don't see a similar argument for copy constructors: in your example, there was no need for QVariant::Private to define a copy constructor, and that seems like a situation where a warning is reasonable, even if the code is in fact correct. Jason