Date
2022-02-18.07:47:23
Message id
2786

Content

N3092 comment US 48
N3092 comment GB 37
N3092 comment DE 10

The requirement that an rvalue reference must be bound to an rvalue is found in 9.5.4 [dcl.init.ref] bullet 5.2:

  • Otherwise, the reference shall be an lvalue reference to a non-volatile const type (i.e., cv1 shall be const), or the reference shall be an rvalue reference and the initializer expression shall be an rvalue or have a function type.

This is not quite correct, as it is phrased in terms of the value category of the initializer expression itself rather than that of the result of any conversions applied to the initializer. It should be permitted to bind an rvalue reference to a temporary created from an lvalue, for instance, or to the rvalue result of a conversion function for an lvalue object of class type. Also, it should not be permitted to bind an rvalue reference to the lvalue result of a conversion function for a class rvalue.