This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/88136, -Wdeprecated-copy too noisy
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 8 Dec 2018 17:58:17 +0100
- Subject: Re: C++ PATCH for c++/88136, -Wdeprecated-copy too noisy
- References: <CADzB+2nxjBAaig10w3-1sZEvAZpTMgWFPeSpF8EWknyzzx_x-Q@mail.gmail.com> <CAFk2RUb5_BNoLXKV=oXG30jk5dkvHsY=5sinYW1+4F+bfHnMLQ@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Dec 08, 2018 at 06:46:27PM +0200, Ville Voutilainen wrote:
> 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
-W is an alias to -Wextra.
> That doesn't have -Wextra. Yet the -Wdeprecated-copy still triggers.
Jakub