C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 09 Feb 2026 21:43:52 -0800
On Monday, 9 February 2026 16:38:26 Pacific Standard Time Barry Revzin wrote:
> Moreover, override and final are... extremely ignorable. All they do is
> request a diagnostic for otherwise well-formed code.

"Diagnostic required" does mean it cannot be ignored: it must be handled and
the diagnostic printed. An implementation is non-conformant if it eats the
token then immediately forgets about it, unlike for attributes.

It would also not be the first case where you can only add a given keyword if
it was already implied: inline, extern and auto (pre-C++11) come to mind, in
some cases. You can add inline to constexpr function declarations or to
definitions functions inside class bodies, but they already implicitly inline.
You can add extern to the forward declaration of a function, but it does
nothing because it's implied. You could add auto to declare that an automatic-
storage variable had automatic storage, but it was implied (and it was also
the only place where you could add it).

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-02-10 05:44:03