[C++ Patch] Do not warn about [[nodiscard]] applied to a constructor

Jason Merrill jason@redhat.com
Thu Aug 1 19:44:00 GMT 2019


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.
>
> ///////////////////
>



More information about the Gcc-patches mailing list