wg21.cmeerw.net

Proposed resolution (April, 2013):

Change the example in 9.2.9.3 [dcl.type.simple] paragraph 4 as follows:

  const int&& foo();
  int i;
  struct A { double x; };
  const A* a = new A();
  decltype(foo()) x1 = i 17;     // type is const int&&
  decltype(i) x2;                // type is int
  decltype(a->x) x3;             // type is double
  decltype((a->x)) x4 = x3;      // type is const double&

The example in 9.2.9.3 [dcl.type.simple] paragraph 4 reads, in part,

  const int&& foo();
  int i;
  decltype(foo()) x1 = i; // type is const int&&

The initialization is an ill-formed attempt to bind an rvalue reference to an lvalue.

History Date User Action Args 2017-02-06 00:00:00adminsetstatus: drwp -> cd4 2015-05-25 00:00:00adminsetstatus: dr -> drwp 2015-04-13 00:00:00adminsetmessages: + msg5361 2014-11-24 00:00:00adminsetstatus: ready -> dr 2014-03-03 00:00:00adminsetstatus: review -> ready 2013-05-03 00:00:00adminsetmessages: + msg4318 2013-05-03 00:00:00adminsetstatus: drafting -> review 2012-12-30 00:00:00admincreate

Read the original on wg21.cmeerw.net ↗