<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1575</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="1575"></A><H4>1575.
  
Incorrect definition of &#8220;strict pointer safety&#8221;
</H4>
<B>Section: </B>_N4885_6.7.5.5.4&#160; [<A href="https://wg21.link/basic.stc.dynamic.safety">basic.stc.dynamic.safety</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Matt Austern
 &#160;&#160;&#160;

 <B>Date: </B>2012-10-17<BR>


<P>[Moved to DR at the September, 2013 meeting.]</P>

<P>According to _N4885_6.7.5.5.4 [<A href="https://wg21.link/basic.stc.dynamic.safety#4">basic.stc.dynamic.safety</A>] paragraph 4,</P>

<BLOCKQUOTE>

an implementation may have <I>strict pointer safety</I>, in which case a
pointer value that is not a safely-derived pointer value is an invalid
pointer value unless the referenced complete object is of dynamic
storage duration and has previously been declared reachable
(_N4885_.20.10.5 [<A href="https://wg21.link/util.dynamic.safety">util.dynamic.safety</A>]).

</BLOCKQUOTE>

<P>&#8220;Safely-derived pointer&#8221; is defined only with
respect to dynamically-allocated storage.  Presumably pointers to
objects with automatic and static storage duration should also be
considered valid.</P>

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

<P>Change _N4885_6.7.5.5.4 [<A href="https://wg21.link/basic.stc.dynamic.safety#4">basic.stc.dynamic.safety</A>] paragraph 4 as follows:</P>

<BLOCKQUOTE>

Alternatively, an implementation may have <I>strict pointer
safety</I>, in which case a pointer value <INS>referring to
an object with dynamic storage duration</INS> that is not a
safely-derived pointer value is an invalid pointer value
unless the referenced complete object <DEL>is of dynamic
storage duration and</DEL> has previously been declared
reachable (_N4885_.20.10.5 [<A href="https://wg21.link/util.dynamic.safety">util.dynamic.safety</A>]). [<I>Note:</I>...

</BLOCKQUOTE>

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