<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1689</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="1689"></A><H4>1689.
  
Syntactic nonterminal for operand 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++14
 &#160;&#160;&#160;

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

 <B>Date: </B>2013-05-26<BR>


<P>[Moved to DR at the February, 2014 meeting.]</P>

<P>
<A HREF="1323.html">Issue 1323</A> dealt with correcting the
specification of the operand of <TT>alignas</TT>, which was originally
given as the nonexistent term <I>alignment-expression</I>.  It was
corrected editorially to match the use of <I>assignment-expression</I>
in 9.13.2 [<A href="https://wg21.link/dcl.align">dcl.align</A>].</P>

<P>In 9.13.2 [<A href="https://wg21.link/dcl.align#2">dcl.align</A>] paragraph 2, the expression is
semantically constrained to be an integral constant expression.  Since
a <I>constant-expression</I> is syntactically
a <I>conditional-expression</I> rather than
an <I>assignment-expression</I>, it would probably make sense to change the
syntactic nonterminal for the operand of <TT>alignas</TT> to be either
a <I>constant-expression</I> or a <I>conditional-expression</I>.</P>

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

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

<UL>
<I>alignment-specifier:</I>
<UL>
<TT>alignas (</TT> <I>type-id</I> <TT>...</TT><SUB><I>opt</I></SUB> <TT>)</TT><BR>
<TT>alignas (</TT> <I><DEL>assignment-expression</DEL> <INS>constant-expression</INS></I> <TT>...</TT><SUB><I>opt</I></SUB> <TT>)</TT>

</UL>

</UL>

<LI><P>Change 9.13.2 [<A href="https://wg21.link/dcl.align#2">dcl.align</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

<P>When the <I>alignment-specifier</I> is of the form
<TT>alignas(</TT> <I><DEL>assignment-expression</DEL>
<INS>constant-expression</INS></I> <TT>)</TT>:</P>

<UL>
<LI>

<P>the <I><DEL>assignment-expression</DEL> <INS>constant-expression</INS></I>
shall be an integral constant expression</P>
</LI>

</UL>

</BLOCKQUOTE>

</OL>

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