Does C++ have the notion of "strict conformance"?

-- Gaby


From: cpp@standards.incits.org <cpp@standards.incits.org> on behalf of Hubert Tong <hstong@ca.ibm.com>
Sent: Saturday, November 12, 2022 7:19:12 AM
To: Aaron Ballman <aaron@aaronballman.com>; Evolution Working Group mailing list <ext@lists.isocpp.org>
Cc: cpp@standards.incits.org <cpp@standards.incits.org>; WG14/WG21 liaison mailing list <liaison@lists.isocpp.org>
Subject: RE: [cpp] Implementer concerns with Defect Report issue 2538 (Can standard attributes be syntactically ignored?) in P2710R0
 
> Further, we are not convinced the effects of this paper are in the best
> interests of users. The result of voting in favor of this proposal is for
> this code to be diagnosed in C++11 mode:
>
> [[deprecated("this has a reason")]] int foo; [[nodiscard("this also has a
> reason")]] int func();
>
> because this proposes, as a DR, to require an implementation to diagnose
> the syntactic violation of providing an attribute argument list when the
> grammar does not allow one for these attributes in that language mode.

Implementations are free to (and probably should) make such a case issue a diagnostic only when strict conformance is requested.

Users requesting strict conformance arguably are well-served by being told that they are using a feature from a newer standard. It might motivate them to actually move to the newer standard.