From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66929 invoked by alias); 8 Dec 2018 16:46:44 -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 66913 invoked by uid 89); 8 Dec 2018 16:46:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Private, wextra, Wextra, noisy X-HELO: mail-ot1-f45.google.com Received: from mail-ot1-f45.google.com (HELO mail-ot1-f45.google.com) (209.85.210.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Dec 2018 16:46:41 +0000 Received: by mail-ot1-f45.google.com with SMTP id f18so6666613otl.11 for ; Sat, 08 Dec 2018 08:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xzjUDn+5v6iCUyJ6Z9iep8jMCW8t6VxwzxXgcNIo81I=; b=KIcEtCVV6CZO2H7r6RSmgrWMtZn23HOZzTkO3Ry7Cb1gqtKRVtRuNEbVZ42tUxnfNw Fobn2xpiK/G9i0AX02LR7yO0Qtq1DmVNXSmCHoeBM2pNi1fo3f8T+88KHn9VRkyn6Nlj L1HNybt05oBeld/2nUwaGxH40rf1a5lplm5kTl3wG46tmedVge0GPDFWihGajB0NitC6 UAWY8YwQXgvWQTEqwHICRMpMq1j+HjTOp7no7bUjxDjO3abnpqjVFXQ3tAvgyCpWBEME S9rUZsDWR4enqatGSIdnlvZsvdB2LqvxXlbwq80SxFCXmI6B8Vy0uKag5AiIlno9Fzpl r1vg== MIME-Version: 1.0 References: In-Reply-To: From: Ville Voutilainen Date: Sat, 08 Dec 2018 16:46:00 -0000 Message-ID: Subject: Re: C++ PATCH for c++/88136, -Wdeprecated-copy too noisy To: Jason Merrill Cc: gcc-patches List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-12/txt/msg00516.txt.bz2 On Thu, 6 Dec 2018 at 23:12, Jason Merrill wrote: > > -Wdeprecated-copy does find some real bugs, but it also complains > about a lot of reasonable code for which the implicitly declared copy > ctor/op=3D are fine oven though the class has a user-defined destructor: > this situation is only problematic if the destructor releases > resources held in one of the non-static data members. > > So, this patch reins it in somewhat: first by moving from -Wall to > -Wextra, and then also only complaining if the other copy op is > user-declared. The old behavior can be explicitly requested with > -Wdeprecated-copy-dtor. Hmm. g++ -c -pipe -O2 -fPIC -std=3Dc++1z -fvisibility=3Dhidden -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -fno-exceptions -Wall -W -Wvla -Wdate-time -Wshift-overflow=3D2 -Wduplicated-cond -Wno-stringop-overflow -Werror -Wno-error=3Dcpp -Wno-error=3Ddeprecated-declarations -Wno-error=3Dstrict-overflow -Wno-error=3Dimplicit-fallthrough -D_REENTRANT -DQT_VERSION_STR=3D'"5.12.0"' -DQT_VERSION_MAJOR=3D5 -DQT_VERSION_MINOR=3D12 -DQT_VERSION_PATCH=3D0 -DQT_BOOTSTRAPPED -DQT_NO_CAST_TO_ASCII -DQT_NO_FOREACH -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=3D0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I/home/vivoutil/kuutti/qt5-5.12/qtbase/src/tools/bootstrap -I. -I../../../include -I../../../include/QtCore -I../../../include/QtCore/5.12.0 -I../../../include/QtCore/5.12.0/QtCore -I../../../include/QtXml -I../../../include/QtXml/5.12.0 -I../../../include/QtXml/5.12.0/QtXml -I/home/vivoutil/kuutti/qt5-5.12/qtbase/mkspecs/linux-g++ -o .obj/qglobal.o /home/vivoutil/kuutti/qt5-5.12/qtbase/src/corelib/global/qgl= obal.cpp In file included from ../../../include/QtCore/qvariant.h:1, from ../../../include/QtCore/5.12.0/QtCore/private/../../../../../../../qtbase/s= rc/corelib/tools/qlocale_p.h:58, from ../../../include/QtCore/5.12.0/QtCore/private/../../../../../../../qtbase/s= rc/corelib/tools/qlocale_tools_p.h:54, from ../../../include/QtCore/5.12.0/QtCore/private/qlocale_tools_p.h:1, from /home/vivoutil/kuutti/qt5-5.12/qtbase/src/corelib/global/qglobal.cpp:52: ../../../include/QtCore/../../../../qtbase/src/corelib/kernel/qvariant.h: In constructor =E2=80=98QVariant::QVariant(QVariant&&)=E2=80=99: ../../../include/QtCore/../../../../qtbase/src/corelib/kernel/qvariant.h:27= 3:25: error: implicitly-declared =E2=80=98constexpr QVariant::Private& QVariant::Private::operator=3D(const QVariant::Private&)=E2=80=99 is deprec= ated [-Werror=3Ddeprecated-copy] 273 | { other.d =3D Private(); } | ^ ../../../include/QtCore/../../../../qtbase/src/corelib/kernel/qvariant.h:39= 9:16: note: because =E2=80=98QVariant::Private=E2=80=99 has user-provided =E2=80=98QVariant::Private::Private(const QVariant::Private&)=E2=80=99 399 | inline Private(const Private &other) Q_DECL_NOTHROW | ^~~~~~~ cc1plus: all warnings being treated as errors That doesn't have -Wextra. Yet the -Wdeprecated-copy still triggers.