public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ville Voutilainen <ville.voutilainen@gmail.com>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH for c++/88136, -Wdeprecated-copy too noisy
Date: Sat, 08 Dec 2018 16:46:00 -0000	[thread overview]
Message-ID: <CAFk2RUb5_BNoLXKV=oXG30jk5dkvHsY=5sinYW1+4F+bfHnMLQ@mail.gmail.com> (raw)
In-Reply-To: <CADzB+2nxjBAaig10w3-1sZEvAZpTMgWFPeSpF8EWknyzzx_x-Q@mail.gmail.com>

On Thu, 6 Dec 2018 at 23:12, Jason Merrill <jason@redhat.com> 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= 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=c++1z -fvisibility=hidden
-fvisibility-inlines-hidden -ffunction-sections -fdata-sections
-fno-exceptions -Wall -W -Wvla -Wdate-time -Wshift-overflow=2
-Wduplicated-cond -Wno-stringop-overflow -Werror -Wno-error=cpp
-Wno-error=deprecated-declarations -Wno-error=strict-overflow
-Wno-error=implicit-fallthrough -D_REENTRANT
-DQT_VERSION_STR='"5.12.0"' -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=12
-DQT_VERSION_PATCH=0 -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=0x050000 -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/qglobal.cpp
In file included from ../../../include/QtCore/qvariant.h:1,
                 from
../../../include/QtCore/5.12.0/QtCore/private/../../../../../../../qtbase/src/corelib/tools/qlocale_p.h:58,
                 from
../../../include/QtCore/5.12.0/QtCore/private/../../../../../../../qtbase/src/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 ‘QVariant::QVariant(QVariant&&)’:
../../../include/QtCore/../../../../qtbase/src/corelib/kernel/qvariant.h:273:25:
error: implicitly-declared ‘constexpr QVariant::Private&
QVariant::Private::operator=(const QVariant::Private&)’ is deprecated
[-Werror=deprecated-copy]
  273 |     { other.d = Private(); }
      |                         ^
../../../include/QtCore/../../../../qtbase/src/corelib/kernel/qvariant.h:399:16:
note: because ‘QVariant::Private’ has user-provided
‘QVariant::Private::Private(const QVariant::Private&)’
  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.

  reply	other threads:[~2018-12-08 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 21:12 Jason Merrill
2018-12-08 16:46 ` Ville Voutilainen [this message]
2018-12-08 16:58   ` Jakub Jelinek
2018-12-08 17:17     ` Ville Voutilainen
2018-12-08 17:53       ` Jason Merrill
2018-12-08 18:05         ` Ville Voutilainen
2018-12-08 18:33           ` Ville Voutilainen
2018-12-12 14:52             ` Jason Merrill
2018-12-12 15:30               ` Ville Voutilainen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFk2RUb5_BNoLXKV=oXG30jk5dkvHsY=5sinYW1+4F+bfHnMLQ@mail.gmail.com' \
    --to=ville.voutilainen@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).