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
{{ message }}
Repository navigation
CWG2978 [temp.deduct.call] Deduction and qualification conversions with references #651
It is not clear whether bullet 4.1 of [temp.deduct.call] allows qualification conversions.
Suggested resolution: Edit [temp.deduct.call]/4.1 as follows:
If the original P is a reference type, the deduced A (i.e., the type referred to by the reference) can be more cv-qualifieda type other than the transformed A that is reference-compatible ([dcl.init.ref]) with the transformed A.
(We might not need to say "transformed", actually. As far as I can tell, when the original P is a reference type, we transform A only in the case where P is a forwarding reference, and in that case no difference in cv-qualification is possible.)
changed the title [-][temp.deduct.call] Deduction and qualification conversions with references[/-][+]CWG2978 [temp.deduct.call] Deduction and qualification conversions with references[/+]on Dec 30, 2024
Activity
eisenwave commentedon Dec 25, 2024
Note that the following code indirectly reproduces this implementation divergence, and that is how the issue was originally discovered:
GCC accepts this, and Clang (with libstdc++) rejects it. See https://stackoverflow.com/q/79264902/5740428
Clang fails to call this overload:
Any resolution should make this construction of
std::spanvalid, in my opinion.jensmaurer commentedon Dec 25, 2024
"reference-compatible" allows derived-to-base conversions, which we don't want here (I think).
Maybe "... can be a type similar to the transformed A that is reference-compatible with the transformed A".
jensmaurer commentedon Dec 30, 2024
CWG2978
[-][temp.deduct.call] Deduction and qualification conversions with references[/-][+]CWG2978 [temp.deduct.call] Deduction and qualification conversions with references[/+]