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
Consider the above example, the rules about deducing conversion function template arguments in defined as
[temp.deduct.conv] p1
Template argument deduction is done by comparing the return type of the conversion function template (call it P) with the type specified by the conversion-type-id of the conversion-function-id being looked up (call it A) as described in [temp.deduct.type]. If the conversion-function-id is constructed during overload resolution ([over.match.funcs]), the following transformations apply.
Implementations give the deduced A with the type int. However, according to [temp.deduct.conv] p1, [temp.deduct.conv] p2, [temp.deduct.conv] p3, and [temp.deduct.conv] p4, the deduced A should be int const. Since [temp.deduct.conv] p4 remove the top-level cv-qualifier prior to remove the reference. For this divergence, Clang's sources give the interpretation, which says
Consider the above example, the rules about deducing conversion function template arguments in defined as
[temp.deduct.conv] p1
Implementations give the deduced
A
with the typeint
. However, according to [temp.deduct.conv] p1, [temp.deduct.conv] p2, [temp.deduct.conv] p3, and [temp.deduct.conv] p4, the deducedA
should beint const
. Since [temp.deduct.conv] p4 remove the top-level cv-qualifier prior to remove the reference. For this divergence, Clang's sources give the interpretation, which saysIf A is a reference type, the type referred to by A is used for type deduction. We work around a defect in the standard here: cv-qualifiers are also removed from P and A in this case, unless P was a reference type.
The text was updated successfully, but these errors were encountered: