C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [cpp] Implementer concerns with Defect Report issue 2538 (Can standard attributes be syntactically ignored?) in P2710R0

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Sun, 13 Nov 2022 02:35:09 +0000
Does C++ have the notion of "strict conformance"?

-- Gaby

________________________________
From: cpp_at_[hidden] <cpp_at_[hidden]> on behalf of Hubert Tong <hstong_at_[hidden]>
Sent: Saturday, November 12, 2022 7:19:12 AM
To: Aaron Ballman <aaron_at_[hidden]>; Evolution Working Group mailing list <ext_at_[hidden]>
Cc: cpp_at_[hidden] <cpp_at_[hidden]>; WG14/WG21 liaison mailing list <liaison_at_[hidden]>
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.


Received on 2022-11-13 02:35:13