On Thu, 5 Aug 2021 at 17:21, Jonathan Wakely via Libstdc++
<libstd...@gcc.gnu.org> wrote:
>
> On 04/08/21 12:55 +0100, Jonathan Wakely wrote:
> >This adds [[nodiscard]] throughout <iterator>, as proposed by P2377R0
> >(with some minor corrections).
> >
> >The attribute is added for all modes from C++11 up, using
> >[[__nodiscard__]] or _GLIBCXX_NODISCARD where C++17 [[nodiscard]] can't
> >be used directly.
>
> This change causes errors when -fconcepts-ts is used. Fixed like so.

But this makes the attribute appertain to the function type, not to
the function. It's also ill-formed:
"The attribute-token nodiscard may be applied to the declarator-id in
a function declaration or to the
declaration of a class or enumeration. " Your change makes nodiscard
be applied to the function declaration,
not to the declarator-id.

Reply via email to