This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] Do not warn about [[nodiscard]] applied to a constructor
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 1 Aug 2019 15:44:27 -0400
- Subject: Re: [C++ Patch] Do not warn about [[nodiscard]] applied to a constructor
- References: <e40fb9e2-65bd-677d-5201-5037d2e9ea19@oracle.com>
OK.
On Thu, Aug 1, 2019 at 12:36 PM Paolo Carlini <paolo.carlini@oracle.com> wrote:
>
> Hi,
>
> in Cologne, during the presentation of P1771R0, Per Sommerlad pointed
> out that apparently GCC was already almost doing the right thing - it
> accepts [[nodiscard]] on a constructor and then a warning is emitted in
> the relevant potentially dangerous situations - but it does first emit a
> warning when it encounters the [[nodiscard]] itself. Avoiding the latter
> seems easy to me - the below passes testing. Something else?
>
> Thanks, Paolo.
>
> ///////////////////
>