<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2538</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2538"></A><H4>2538.
  
Can standard attributes be syntactically ignored?
</H4>
<B>Section: </B>9.13.1&#160; [<A href="https://wg21.link/dcl.attr.grammar">dcl.attr.grammar</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++23
 &#160;&#160;&#160;

 <B>Submitter: </B>Jens Maurer
 &#160;&#160;&#160;

 <B>Date: </B>2021-12-02
  &#160;&#160;&#160;
  <B>Liaison: </B>EWG<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2720r0.pdf#GB055">P2720R0 comment
  GB&#160;055<BR></A>

<P>[Accepted as a DR at the November, 2022 meeting.]</P>



<P>Subclause 9.13.1 [<A href="https://wg21.link/dcl.attr.grammar#6">dcl.attr.grammar</A>] paragraph 6 specifies
that an unrecognized <I>attribute-token</I> is ignored:</P>

<BLOCKQUOTE>

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

</BLOCKQUOTE>

<P>The intent is that only non-standard
unrecognized <I>attribute-token</I>s 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.</P>

<P>The paper introducing attributes was
<A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf">N2761</A>;
the phrasing in question was introduced by
<A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r2.html">P0283R2</A>
attempting to implement the design change presented in
<A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r1.pdf">P0283R1</A>.
</P>

<P>See also paper
<A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2552r0.pdf">P2552</A>
(On the ignorability of standard attributes).</P>

<P><U>Suggested resolution:</U></P>

<P>Change in 9.13.1 [<A href="https://wg21.link/dcl.attr.grammar#6">dcl.attr.grammar</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

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

</BLOCKQUOTE>

<P><B>EWG telecon 2022-05-26</B></P>

<P>See <A HREF="https://github.com/cplusplus/papers/issues/1252">paper
issue 1252</A>.
</P>

<P>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.</P>

<P><B>Proposed resolution (approved by CWG 2022-07-01) [SUPERSEDED]:</B></P>

<P>Change in 9.13.1 [<A href="https://wg21.link/dcl.attr.grammar#6">dcl.attr.grammar</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

For an <I>attribute-token</I> (including an
<I>attribute-scoped-token</I>) not specified in this document, the
behavior is implementation-defined<DEL>. Any</DEL> <INS>; any such</INS>
<I>attribute-token</I> that is not recognized by the implementation
is ignored.
<INS>[ Note: A program is ill-formed if it contains
an <I>attribute</I> specified in 9.13 [<A href="https://wg21.link/dcl.attr">dcl.attr</A>] that
violates the rules to which entity or statement the attribute may
apply or the syntax rules for the
attribute's <I>attribute-argument-clause</I>, if any.  -- end note
]</INS>
</BLOCKQUOTE>

<P><B>EWG 2022-06 electronic polling</B></P>

<P>No consensus. See
<A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1018r17.html#CWG2538">vote</A>.</P>

<P><B>EWG 2022-11-08</B></P>

<P>Approved the direction of the 2022-07-01 proposed resolution.</P>


<P><B>Proposed resolution (approved by CWG 2022-11-08):</B></P>

<P>Change in 9.13.1 [<A href="https://wg21.link/dcl.attr.grammar#6">dcl.attr.grammar</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

For an <I>attribute-token</I> (including an
<I>attribute-scoped-token</I>) not specified in this document, the
behavior is implementation-defined<DEL>. Any</DEL> <INS>; any such</INS>
<I>attribute-token</I> that is not recognized by the implementation
is ignored.
<INS>[ Note: A program is ill-formed if it contains
an <I>attribute</I> specified in 9.13 [<A href="https://wg21.link/dcl.attr">dcl.attr</A>] that
violates the rules specifying to which entity or statement the attribute may
apply or the syntax rules for the
attribute's <I>attribute-argument-clause</I>, if any.  -- end note
]</INS>
</BLOCKQUOTE>

<BR><BR>
</BODY>
</HTML>
