Title
Can standard attributes be syntactically ignored?
Status
open
Section
9.12.1 [dcl.attr.grammar]
Submitter
Jens Maurer

Created on 2021-12-02.00:00:00 last changed 1 month ago

Messages

Date: 2022-07-10.07:18:01

Proposed resolution (approved by CWG 2022-07-01):

Change in 9.12.1 [dcl.attr.grammar] paragraph 6 as follows:

For an attribute-token (including an attribute-scoped-token) not specified in this document, the behavior is implementation-defined. Any ; any such attribute-token that is not recognized by the implementation is ignored. [ Note: A program is ill-formed if it contains an attribute specified in 9.12 [dcl.attr] that violates the rules to which entity or statement the attribute may apply or the syntax rules for the attribute's attribute-argument-clause, if any. -- end note ]

EWG 2022-06 electronic polling

No consensus. See vote.

Date: 2022-05-26.19:25:10

Suggested resolution:

Change in 9.12.1 [dcl.attr.grammar] paragraph 6 as follows:

For an attribute-token (including an attribute-scoped-token) not specified in this document, the behavior is implementation-defined. Any ; any such attribute-token that is not recognized by the implementation is ignored.

EWG telecon 2022-05-26

See paper issue 1252.

There was consensus for the statement "It is EWG's intent that [dcl.attr]/6 ONLY permits an implementation to ignore a standard attribute's effect, but not appertainment and argument parsing." To be confirmed by electronic polling.

Date: 2022-02-18.07:47:23

Subclause 9.12.1 [dcl.attr.grammar] paragraph 6 specifies that an unrecognized attribute-token is ignored:

For an attribute-token (including an attribute-scoped-token) not specified in this document, the behavior is implementation-defined. Any attribute-token that is not recognized by the implementation is ignored.

The intent is that only non-standard unrecognized attribute-tokens can be ignored; in particular, an implementation is required to syntax-check all standard attributes, even if the implementation then chooses not to effect any semantics for that attribute.

The paper introducing attributes was N2761; the phrasing in question was introduced by P0283R2 attempting to implement the design change presented in P0283R1.

See also paper P2552 (On the ignorability of standard attributes).

History
Date User Action Args
2022-07-10 07:18:01adminsetstatus: ready -> open
2022-07-01 20:46:59adminsetstatus: open -> ready
2022-06-26 07:51:04adminsetmessages: + msg6871
2022-02-18 07:47:23adminsetmessages: + msg6744
2021-12-02 00:00:00admincreate