You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[dcl.init.ref]/5 mentions "temporary materialization" twice in (5.3) and (5.4.2). Both appears alongwith cv-qualification adjustments.
If the converted initializer is a prvalue, its type T4 is adjusted to type “cv1T4” ([conv.qual]) and the temporary materialization conversion ([conv.rval]) is applied.
The temporary materialization conversion is applied, considering the type of the prvalue to be “cv1T1”, and the reference is bound to the result.
The adjustments in 5.4.2 was added via CWG2481, and it's clear that in the case of 5.4.2, the cv-qualification won't be stripped.
Are the adjustments in 5.3 (pre-existing in published C++17) samely treated? If so, should we make wording for these adjustments more consistent? (Or just say it once?)
BTW, consider these following definitions.
constint& ref1 = 42;
constint& ref2 = 42L;
It's clear that the definition of ref2 falls into the case of [dcl.init.ref]/(5.4.2). However, it seems that the definition of ref1 is handled by [dcl.init.ref]/(5.3.1) (because it's "rvalue" but not "xvalue" that is used in 5.3.1).
Is it intended that they fall in different cases while the treatments should be very similar?
The text was updated successfully, but these errors were encountered:
frederick-vs-ja
changed the title
[dcl.init.ref] Cv-qualification adjustments before temporary materialization
[dcl.init.ref] Cv-qualification adjustments before temporary materialization CWG2657
Nov 29, 2022
[dcl.init.ref]/5 mentions "temporary materialization" twice in (5.3) and (5.4.2). Both appears alongwith cv-qualification adjustments.
The adjustments in 5.4.2 was added via CWG2481, and it's clear that in the case of 5.4.2, the cv-qualification won't be stripped.
Are the adjustments in 5.3 (pre-existing in published C++17) samely treated? If so, should we make wording for these adjustments more consistent? (Or just say it once?)
BTW, consider these following definitions.
It's clear that the definition of
ref2
falls into the case of [dcl.init.ref]/(5.4.2). However, it seems that the definition ofref1
is handled by [dcl.init.ref]/(5.3.1) (because it's "rvalue" but not "xvalue" that is used in 5.3.1).Is it intended that they fall in different cases while the treatments should be very similar?
(These are raised from a question on Stack Overflow).
This is now CWG2657.
The text was updated successfully, but these errors were encountered: