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
A conversion function is never used to convert a (possibly cv-qualified) object to the (possibly cv-qualified) same object type (or a reference to it), to a (possibly cv-qualified) base class of that type (or a reference to it), or to cvvoid.
There is a footnote that explains the reasons: a derived to base conversion is a standard conversion (so a user-defined conversion function will never be considered for such a conversion) and the special rules for conversion to void do not involve any search for a conversion function. That means [class.conv.fct]/4 is normatively redundant and should be demoted to a note.
Suggested resolution: Edit [class.conv.fct]/4, integrating the footnote into the paragraph:
[Note -?-: A conversion function is never used to convert a (possibly cv-qualified) object to the (possibly cv-qualified) same object type (or a reference to it), to a (possibly cv-qualified) base class of that type (or a reference to it), or to cvvoid. These conversions are considered as standard conversions for the purposes of overload resolution ([over.best.ics], [over.ics.ref]) and therefore initialization ([dcl.init]) and explicit casts ([expr.static.cast]). A conversion to void does not invoke any conversion function ([expr.static.cast]). Even though never directly called to perform a conversion, such conversion functions can be declared and can potentially be reached through a call to a virtual conversion function in a base class. —end note]
[Example 1: [...]]
We might also want to consider clarifying what "never used to convert" means. NVC++ produces a warning that says "will not be called for implicit or explicit conversions", which I think is roughly what I would want to say here: "never used to implicitly or explicitly convert".
The text was updated successfully, but these errors were encountered:
Full name of submitter: Brian Bi
Reference (section label): [class.conv.fct]
Issue description: [class.conv.fct]/4 reads:
There is a footnote that explains the reasons: a derived to base conversion is a standard conversion (so a user-defined conversion function will never be considered for such a conversion) and the special rules for conversion to
void
do not involve any search for a conversion function. That means [class.conv.fct]/4 is normatively redundant and should be demoted to a note.Suggested resolution: Edit [class.conv.fct]/4, integrating the footnote into the paragraph:
We might also want to consider clarifying what "never used to convert" means. NVC++ produces a warning that says "will not be called for implicit or explicit conversions", which I think is roughly what I would want to say here: "never used to implicitly or explicitly convert".
The text was updated successfully, but these errors were encountered: