<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2006</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="2006"></A><H4>2006.
  
Cv-qualified <TT>void</TT> types
</H4>
<B>Section: </B>6.9.4&#160; [<A href="https://wg21.link/basic.compound">basic.compound</A>]
 &#160;&#160;&#160;

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

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

 <B>Date: </B>2014-09-16<BR>


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



<P>According to 6.9.4 [<A href="https://wg21.link/basic.compound#3">basic.compound</A>] paragraph 3,</P>

<BLOCKQUOTE>

The type of a pointer to <TT>void</TT> or a pointer to an object type
is called an <I>object pointer type</I>. [<I>Note:</I> A pointer to
<TT>void</TT> does not have a pointer-to-object type, however,
because <TT>void</TT> is not an object type. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>This wording excludes cv-qualified <TT>void</TT> types.  There
are other references in the Standard to &#8220;<TT>void</TT>
type&#8221; that are apparently intended to include cv-qualified
versions as well.</P>

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

<OL>
<LI><P>Change 6.9 [<A href="https://wg21.link/basic.types#5">basic.types</A>] paragraph 5 as follows:</P></LI>

<BLOCKQUOTE>

...Incompletely-defined object types and <DEL>the void types</DEL>
<INS><I>cv</I> <TT>void</TT></INS> are incomplete types
(6.9.2 [<A href="https://wg21.link/basic.fundamental">basic.fundamental</A>])...

</BLOCKQUOTE>

<LI><P>Change 6.9 [<A href="https://wg21.link/basic.types#8">basic.types</A>] paragraph 8 as follows:</P></LI>

<BLOCKQUOTE>

An object type is a (possibly cv-qualified) type that is not
a function type, not a reference type, and not <DEL>a void type</DEL>
<INS><I>cv</I> <TT>void</TT></INS>.

</BLOCKQUOTE>

<LI><P>Change 6.9.2 [<A href="https://wg21.link/basic.fundamental#9">basic.fundamental</A>] paragraph 9 as follows:</P></LI>

<BLOCKQUOTE>

<DEL>The <TT>void</TT> type has an empty set of values. The</DEL>
<INS>A type <I>cv</I></INS> <TT>void</TT> <DEL>type</DEL> is
an incomplete type that cannot be completed<INS>; such a type
has an empty set of values</INS>. It is used as
the return type for functions that do not return a
value. Any expression can be explicitly converted to type <I>cv</I>
<TT>void</TT> (7.6.3 [<A href="https://wg21.link/expr.cast">expr.cast</A>]). An expression of type
<INS><I>cv</I></INS> <TT>void</TT> shall be used only as an
expression statement (8.3 [<A href="https://wg21.link/stmt.expr">stmt.expr</A>]), as an
operand of a comma expression (7.6.20 [<A href="https://wg21.link/expr.comma">expr.comma</A>]),
as a second or third operand of <TT>?:</TT>
(7.6.16 [<A href="https://wg21.link/expr.cond">expr.cond</A>]), as the operand of
<TT>typeid</TT>, <TT>noexcept</TT>, or <TT>decltype</TT>, as
the expression in a return statement
(8.8.4 [<A href="https://wg21.link/stmt.return">stmt.return</A>]) for a function with the return
type <INS><I>cv</I></INS> <TT>void</TT>, or as the operand
of an explicit conversion to type <I>cv</I> <TT>void</TT>.

</BLOCKQUOTE>

<LI><P>Change bullet 1.3 of 6.9.4 [<A href="https://wg21.link/basic.compound">basic.compound</A>] as follows:</P></LI>

<UL><LI><P>
<I>pointers</I>
to <INS><I>cv</I></INS> <TT>void</TT> or objects or
functions (including static members of classes) of a given
type, 9.3.4.2 [<A href="https://wg21.link/dcl.ptr">dcl.ptr</A>];</P></LI></UL>

<LI><P>Change 6.9.4 [<A href="https://wg21.link/basic.compound#3">basic.compound</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

The type of a pointer to <INS><I>cv</I></INS> <TT>void</TT>
or a pointer to an object type is called an <I>object
pointer type</I>. [<I>Note:</I>...

</BLOCKQUOTE>

</OL>

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