C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Named Return Value Optimisation [[nrvo]]

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Tue, 10 Feb 2026 00:10:04 +0000
On Mon, 9 Feb 2026, 23:53 Thiago Macieira via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> On Monday, 9 February 2026 15:40:49 Pacific Standard Time Barry Revzin
> wrote:
> > And that reason has nothing to do with the alleged ignorability of
> > attributes.
> >
> > It was originally [[align(X)]]. It only changed because C didn't have
> > attributes yet and was pursuing _Align(...), so C and C++ unified on
> > _Alignas(...) and alignas(...). That's why it's in the spot it's at, and
> > why [dcl.align] (not alignas) is under [dcl.attr].
> >
> > We didn't need a new keyword for aligning anymore than we needed a new
> > keyword for overriding.
>
> And yet, neither override, final, nor alignas are ignorable. The program
> is
> ill-formed if it overrides a non-virtual or final virtual, so it shouldn't
> be
> an attribute.


This is somewhat circular. Attributes must be ignorable, so things that
aren't ignorable can't be attributes. But why must they be ignorable?

Anyway, override is ignorable by our definition of ignorable, because if
you remove all uses of override from a correct program then nothing
changes.

Similarly, if you remove all uses of final from a correct program, nothing
changes. (At least, until we broke that by adding std::is_final, so now you
can make things depend on it).



And no one is going to argue we needed a syntax compatible with
> C for those.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Data Center - Platform & Sys. Eng.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2026-02-10 00:10:20