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

Created on 2021-12-02.00:00:00 last changed 8 months ago

Messages

Date: 2022-11-09.00:27:59

Proposed resolution (approved by CWG 2022-11-08):

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 specifying to which entity or statement the attribute may apply or the syntax rules for the attribute's attribute-argument-clause, if any. -- end note ]
Date: 2022-11-09.00:27:59

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

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.

EWG 2022-11-08

Approved the direction of the 2022-07-01 proposed resolution.

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-11-27.21:00:25
P2720R0 comment GB 055

[Accepted as a DR at the November, 2022 meeting.]

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
2023-07-16 13:00:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: drwp -> open
2023-02-18 18:43:04adminsetstatus: dr -> drwp
2022-11-25 05:14:04adminsetstatus: nb -> dr
2022-11-09 05:54:52adminsetstatus: open -> nb
2022-11-09 05:54:52adminsetstatus: open -> open
2022-11-09 05:54:52adminsetstatus: open -> open
2022-11-09 05:54:52adminsetstatus: open -> open
2022-11-09 00:27:59adminsetmessages: + msg6989
2022-11-08 22:29:05adminsetstatus: nb -> open
2022-11-08 22:29:05adminsetstatus: nb -> nb
2022-11-08 22:29:05adminsetstatus: nb -> nb
2022-07-10 07:18:01adminsetstatus: ready -> nb
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