5
votes

[conv]/6 (emphasis is mine):

The effect of any implicit conversion is the same as performing the corresponding declaration and initialization and then using the temporary variable as the result of the conversion. The result is an lvalue if T is an lvalue reference type or an rvalue reference to function type ([dcl.ref]), an xvalue if T is an rvalue reference to object type, and a prvalue otherwise. The expression e is used as a glvalue if and only if the initialization uses it as a glvalue.

What is the meaning of the highlighted statement above, in the context of this specific paragraph?

1
If and only if is a mathematical term: https://en.wikipedia.org/wiki/If_and_only_ifRotem
a glvalue is an expression whose evaluation determines the identity of an object, bit-field, or function: http://en.cppreference.com/w/cpp/language/value_categoryRotem

1 Answers

2
votes

The intent of that sentence is to clarify that an expression like i (where i is a variable) is not spuriously treated as a glvalue in contexts in which i is immediately converted to a prvalue.

For instance, in

int main() {
  const int j = 0;
  constexpr int i = j;
}

The second definition would be ill-formed if j was considered a glvalue, as j is not a permitted result of a constant expression. However, j is used as a prvalue since the initialization uses it as one, hence the other rule in the linked paragraph applies (and the definition is well-formed).