<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2205</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="2205"></A><H4>2205.
  
Restrictions on use of <TT>alignas</TT>
</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++17
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2015-11-30<BR>


<P>[Adopted at the February/March, 2017 meeting.]</P>



<P>According to 9.13.1 [<A href="https://wg21.link/dcl.attr.grammar#5">dcl.attr.grammar</A>] paragraph 5, a program is
ill-formed if an <I>attribute</I> appertains to an entity or statement to
which it is not allowed to apply. Presumably an <I>alignment-specifier</I>
should have the same restriction.</P>

<P><B>Proposed resolution (November, 2016):</B></P>

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

<BLOCKQUOTE>

Each <I>attribute-specifier-seq</I> is said to <I>appertain</I> to some
entity or statement, identified by the syntactic context where it appears
(Clause 8 [<A href="https://wg21.link/stmt">stmt</A>], 9.1 [<A href="https://wg21.link/dcl.pre">dcl.pre</A>],
9.3 [<A href="https://wg21.link/dcl.decl">dcl.decl</A>]). If an <I>attribute-specifier-seq</I> that
appertains to some entity or statement contains an <I>attribute</I>
<INS>or <I>alignment-specifier</I></INS> that is not allowed to apply to
that entity or statement, the program is ill-formed. If
an <I>attribute-specifier-seq</I> appertains to a friend declaration
(11.8.4 [<A href="https://wg21.link/class.friend">class.friend</A>]), that declaration shall be a
definition. No <I>attribute-specifier-seq</I> shall appertain to an
explicit instantiation (13.9.3 [<A href="https://wg21.link/temp.explicit">temp.explicit</A>]).

</BLOCKQUOTE>

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