<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1550</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="1550"></A><H4>1550.
  
Parenthesized <I>throw-expression</I> operand of <I>conditional-expression</I>
</H4>
<B>Section: </B>7.6.16&#160; [<A href="https://wg21.link/expr.cond">expr.cond</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2012-09-04<BR>


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



<P>The current wording of 7.6.16 [<A href="https://wg21.link/expr.cond#2">expr.cond</A>] paragraph 2 says,</P>

<BLOCKQUOTE>

<P>If either the second or the third operand has type <TT>void</TT>,
then the lvalue-to-rvalue (7.3.2 [<A href="https://wg21.link/conv.lval">conv.lval</A>]), array-to-pointer
(7.3.3 [<A href="https://wg21.link/conv.array">conv.array</A>]), and function-to-pointer (7.3.4 [<A href="https://wg21.link/conv.func">conv.func</A>]) standard conversions are performed on the second and
third operands, and one of the following shall hold:</P>

<UL>
<LI><P>The second or the third operand (but not both) is a
<I>throw-expression</I> (14.2 [<A href="https://wg21.link/except.throw">except.throw</A>]); the result is of
the type of the other and is a prvalue.</P></LI>

<LI>

<P>Both the second and the third operands have type <TT>void</TT>; the
result is of type <TT>void</TT> and is a prvalue.  [<I>Note:</I> This
includes the case where both operands are <I>throw-expression</I>s.
&#8212;<I>end note</I>]</P>
</LI>

</UL>

</BLOCKQUOTE>

<P>A parenthesized <I>throw-expression</I> is a
<I>primary-expression</I>, not a <I>throw-expression</I>.  Should a
parenthesized <I>throw-expression</I> be considered a
<I>throw-expression</I> for this purpose?</P>

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

<P>Change 7.6.16 [<A href="https://wg21.link/expr.cond#2">expr.cond</A>] paragraph 2 as follows:</P>

<BLOCKQUOTE>

<P>If either the second or the third operand has type <TT>void</TT>,
<DEL>then the lvalue-to-rvalue (7.3.2 [<A href="https://wg21.link/conv.lval">conv.lval</A>]), array-to-pointer
(7.3.3 [<A href="https://wg21.link/conv.array">conv.array</A>]), and function-to-pointer (7.3.4 [<A href="https://wg21.link/conv.func">conv.func</A>]) standard conversions are performed on the second and
third operands, and</DEL> one of the following shall hold:</P>

<UL>
<LI><P>The second or the third operand (but not both) is a
<INS>(possibly parenthesized)</INS> <I>throw-expression</I>
(14.2 [<A href="https://wg21.link/except.throw">except.throw</A>]); the result is of the type <INS>and value
category</INS> of the other <DEL>and is a prvalue</DEL>.</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<P>(This resolution also resolves <A HREF="1560.html">issue 1560</A>.)</P>

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