Date
2012-10-15.00:00:00
Message id
4229

Content

The example just before the final bullet of 9.5.5 [dcl.init.list] paragraph 5 is incorrect. It reads, in part,

  struct X {
    operator int&();
  } x;
  int&& rri2 = X(); // error: lvalue-to-rvalue conversion applied to the
                    // result of operator int&

In fact, according to 12.2.2.7 [over.match.ref] (as clarified by the proposed resolution of issue 1328, although the intent was arguably the same for the previous wording), X::operator int&() is not a candidate for the initialization of rri2, so the case falls into the last bullet, creating an int temporary.

It is not clear whether the lvalue-to-rvalue conversion whose prohibition is intended to be illustrated by that example could actually occur, given the specification of candidate functions in 12.2.2.7 [over.match.ref].