C++ Logo


Advanced search

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

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Sun, 13 Nov 2022 00:09:45 -0500
On Sat, Nov 12, 2022 at 9:35 PM Gabriel Dos Reis via Liaison <
liaison_at_[hidden]> wrote:

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

The standard speaks of conforming implementations.

Implementations do not always act as conforming implementations. Sometimes
users like that. Sometimes they don't.

One way users like implementation non-conformance is when they allow users
to violate the rules of the language (without a diagnostic) when
implementations could do something "useful" for their ill-formed programs.
Some users respect what the standard says a bit more (or that the "useful"
things the implementations do are ill-advised) and decide that they would
like diagnostics for those programs.

I believe that users tend to like for their overload sets to act
predictably though, so it would make sense for rules set by the standard to
be used to determine errors that cause substitution failure.

> -- 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.
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2022/11/1139.php

Received on 2022-11-13 05:10:16