<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2027</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="2027"></A><H4>2027.
  
Unclear requirements for multiple <TT>alignas</TT> specifiers
</H4>
<B>Section: </B>9.13.2&#160; [<A href="https://wg21.link/dcl.align">dcl.align</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-20<BR>


<P>[Moved to DR at the October, 2015 meeting.]</P>



<P>The description of <I>alignment-specifier</I>s is unclear.  For
example, 9.13.2 [<A href="https://wg21.link/dcl.align#2.2">dcl.align</A>] bullet 2.2 says,</P>

<BLOCKQUOTE>

if the constant expression evaluates to a fundamental alignment, the
alignment requirement of the declared entity shall be the specified
fundamental alignment

</BLOCKQUOTE>

<P>However, paragraph 4 says,</P>

<BLOCKQUOTE>

When multiple <I>alignment-specifier</I>s are specified for an entity, the
alignment requirement shall be set to the strictest specified alignment.

</BLOCKQUOTE>

<P>meaning that a less-strict alignment will be ignored, rather than
being the alignment of the entity, and presumably meaning that no
diagnostic is required for an insufficiently-strict alignment if a
more stringent requirement is also supplied.</P>

<P><B>Proposed resolution (May, 2015):</B></P>

<OL>
<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>constant-expression</I> <TT>)</TT>:</P>

<UL>
<LI><P>the <I>constant-expression</I> shall be an integral constant
expression<INS>;</INS>
</P></LI>

<LI><P><DEL>if the constant expression evaluates to a fundamental
alignment, the alignment requirement of the declared entity
shall be the specified fundamental alignment</DEL></P></LI>

<LI><P><DEL>if the constant expression evaluates to an extended
alignment and the implementation supports that alignment in
the context of the declaration, the alignment of the
declared entity shall be that alignment</DEL></P></LI>

<LI><P>if the constant expression <INS>does not evaluate to
an alignment value (6.8.3 [<A href="https://wg21.link/basic.align">basic.align</A>]), or</INS>
evaluates to an extended alignment and the implementation
does not support that alignment in the context of the
declaration, the program is ill-formed<INS>.</INS>
</P></LI>

<LI><P><DEL>if the constant expression evaluates to zero, the alignment
specifier shall have no effect</DEL></P></LI>

<LI><P><DEL>otherwise, the program is ill-formed.</DEL></P></LI>

</UL>

</BLOCKQUOTE>

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

<BLOCKQUOTE>

<DEL>When multiple <I>alignment-specifier</I>s are specified
for an entity, the</DEL> <INS>The</INS> alignment
requirement <DEL>shall be set to</DEL> <INS>of an entity
is</INS> the strictest <DEL>specified</DEL> <INS>non-zero</INS> alignment
<INS>specified by its <I>alignment-specifier</I>s, if any; otherwise,
the <I>alignment-specifier</I>s have no effect</INS>.

</BLOCKQUOTE>

</OL>

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