-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Full name of submitter: Brian Bi
Reference (section label): [class.temporary]
Issue description: The term "temporary expression" is currently used in two places in the standard: [class.base.init]/8 "A temporary expression bound to a reference member in a _mem-initializer is ill-formed." and [class.base.init]/11 "A temporary expression bound to a reference member from a default member initializer is ill-formed." However, this term has not been defined.
Suggested resolution:
Edit [class.temporary]/6:
The third context is when a reference binds to a temporary object.
The temporary object to which theA temporary expression is a glvalue obtained through one of the following:
reference is bound or the temporary object that is the complete object of a subobject to which the reference
is bound persists for the lifetime of the reference if the glvalue to which the reference is bound was
a temporary materialization conversion (7.3.5),
(
expression)
, where expression isone of these expressionsa temporary expression,subscripting (7.6.1.2) of an array operand, where that operand is
one of these expressionsa temporary expression,a class member access (7.6.1.5) using the
.
operator where the left operand isone of these expressionsa temporary expression and the right operand designates a non-static data member of non-reference type,a pointer-to-member operation (7.6.4) using the
.*
operator where the left operand isone of thesea temporary expression and the right operand is a pointer to data member of non-reference type,
expressionsa
const_cast
(7.6.1.11),static_cast
(7.6.1.9),dynamic_cast
(7.6.1.7), orreinterpret_cast
(7.6.1.10)converting, without a user-defined conversion, a
glvalue operand that is one of these expressionstemporary expression to a glvalue that refers to the object designated by the operand, or to its complete object or a subobject thereof,a glvalue conditional expression (7.6.16)
that is a glvaluedesignating either its second or third operand, where the selected operand is a temporary expressionwhere the second or third operand is one of these expressions, ora glvalue comma expression (7.6.20)
that is a glvaluewhere the right operand isone of these expressionsa temporary expression.If the reference is bound to a temporary expression, the complete object of the object designated by the temporary expression persists for the lifetime of the reference.