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

2024-04-18


27. Overload ambiguities for builtin ?: prototypes

Section: 12.5  [over.built]     Status: NAD     Submitter: Jason Merrill     Date: 25 Sep 1997

I understand that the lvalue-to-rvalue conversion was removed in London. I generally agree with this, but it means that ?: needs to be fixed:

Given:

    bool test;
    Integer a, b;
    test ? a : b;
What builtin do we use? The candidates are
    operator ?:(bool, const Integer &, const Integer &)
    operator ?:(bool, Integer, Integer)
which are both perfect matches.

(Not a problem in the C++11 FDIS, but misleading.)

Rationale: The description of the conditional operator in 7.6.16 [expr.cond] handles the lvalue case before the prototype is considered.