<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 457</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="457"></A><H4>457.
  
Wording nit on use of const variables in constant expressions
</H4>
<B>Section: </B>7.7&#160; [<A href="https://wg21.link/expr.const">expr.const</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Mark Mitchell
 &#160;&#160;&#160;

 <B>Date: </B>03 Feb 2004<BR>


<P>[Voted into WP at April 2005 meeting.]</P>

<P>I'm looking at 7.7 [<A href="https://wg21.link/expr.const">expr.const</A>].  I see:</P>
<BLOCKQUOTE>
    An <I>integral constant-expression</I> can involve only ... const
variables or static data
   members of integral or enumeration types initialized with constant
expressions ...
</BLOCKQUOTE>
<P>Shouldn't that be "const non-volatile"? </P>

<P>It seems weird to say that:
<PRE>
  const volatile int i = 3;
  int j[i];
</PRE>
is valid.</P>

<P>
<U>Steve Adamczyk:</U> See <A HREF="76.html">issue 76</A>,
which made the similar change to 9.2.9.2 [<A href="https://wg21.link/dcl.type.cv#2">dcl.type.cv</A>] paragraph 2,
 and probably should have changed this one as
well.</P>

<P><B>Proposed resolution (October, 2004):</B></P>

<P>Change the first sentence in the second part of 7.7 [<A href="https://wg21.link/expr.const#1">expr.const</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

An <I>integral constant-expression</I> can involve only literals
of arithmetic types (5.13 [<A href="https://wg21.link/lex.literal">lex.literal</A>], 6.9.2 [<A href="https://wg21.link/basic.fundamental">basic.fundamental</A>]), enumerators, <INS>non-volatile</INS>
<TT>const</TT> variables or static data members of integral or
enumeration types initialized with constant expressions
(9.5 [<A href="https://wg21.link/dcl.init">dcl.init</A>]),
non-type template parameters of integral or enumeration types,
and <TT>sizeof</TT> expressions.

</BLOCKQUOTE>

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