<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2489</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="2489"></A><H4>2489.
  
Storage provided by array of <TT>char</TT>
</H4>
<B>Section: </B>6.8.2&#160; [<A href="https://wg21.link/intro.object">intro.object</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Jiang An
 &#160;&#160;&#160;

 <B>Date: </B>2021-04-15<BR>


<P>[Accepted as a DR at the February, 2023 meeting.]</P>

<P>According to 6.8.2 [<A href="https://wg21.link/intro.object#3">intro.object</A>] paragraph 3,</P>

<BLOCKQUOTE>

If a complete object is created
(7.6.2.8 [<A href="https://wg21.link/expr.new">expr.new</A>]) in storage associated with
another object <I>e</I> of type &#8220;array of <I>N</I>
<TT>unsigned char</TT>&#8221; or of type &#8220;array of <I>N</I>
<TT>std::byte</TT>&#8221; (17.2.1 [<A href="https://wg21.link/cstddef.syn">cstddef.syn</A>]),
that array <I>provides storage</I> for the created object if...

</BLOCKQUOTE>

<P>However, note 4 in paragraph 13 indicates that a
<TT>char</TT> array can also provide storage:</P>

<BLOCKQUOTE>

<P>An operation that begins the lifetime of an array
of <TT>char</TT>, <TT>unsigned char</TT>, or
<TT>std::byte</TT> implicitly creates objects within the
region of storage occupied by the array.</P>

<P>[<I>Note 4</I>: The array object provides storage for
these objects. &#8212;<I>end note</I>]</P>

</BLOCKQUOTE>

<P>The normative text and the note should be reconciled.</P>

<P><B>Proposed resolution (approved by CWG 2023-02-09):</B></P>

<P>Change in 6.8.2 [<A href="https://wg21.link/intro.object#13">intro.object</A>] paragraph 13 as follows:</P>

<BLOCKQUOTE>

An operation that begins the lifetime of an array
of <DEL><TT>char</TT>,</DEL> <TT>unsigned char</TT><DEL>,</DEL>
or <TT>std::byte</TT> implicitly creates objects within the region of
storage occupied by the array.

</BLOCKQUOTE>

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