This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


2316. Simplifying class conversions in conditional expressions

Section: 7.6.16  [expr.cond]     Status: drafting     Submitter: S. B. Tam     Date: 2016-08-16

According to 7.6.16 [expr.cond] paragraph 4,

Attempts are made to form an implicit conversion sequence from an operand expression E1 of type T1 to a target type related to the type T2 of the operand expression E2 as follows:

It seems that to satisfy the conditions in the first two sub-bullets, T2 must be a class type, in which case T2 is the same as the type described in the third sub-bullet, since the lvalue-to-rvalue conversion does not change types and the other two conversions do not apply to a class type. Thus, this bullet and sub-bullets could be simplified to:

Notes from the August, 2020 teleconference:

This issue and suggested resolution predate the resolution of issue 2321, which added the second sub-bullet (the citation above reflects the wording after adoption of issue 2321), giving the result the cv-qualification of T1 instead of that of T2. The suggested resolution would revert that accepted resolution.