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
CWG2958 [over.ics.rank] Incorrect example of overload resolution with qualification conversion #639
intg(constint*); // (1)intg(constvolatileint* const&); // (2)int* p;
int k = g(p); // calls g(const int*)
(1) involves an lvalue-to-rvalue conversion followed by a qualification conversion, whereas (2) only requires a qualification conversion. Since [over.ics.rank]/3.2.5 assumes:
S1 and S2 differ only in their qualification conversion ([conv.qual]) [...]
This call should be ambiguous. This issue was initially discussed on Slack. The above example was introduced in CWG2803.
Suggested resolution: Modify the example as follows:
intg(constint* const&);
intg(constvolatileint* const&);
int* p;
int k = g(p); // calls g(const int* const&)
changed the title [-][over.ics.rank] Incorrect Example of Overload Resolution with Qualification Conversion[/-][+]CWG2958 [over.ics.rank] Incorrect Example of Overload Resolution with Qualification Conversion[/+]on Nov 11, 2024
ghost changed the title [-]CWG2958 [over.ics.rank] Incorrect Example of Overload Resolution with Qualification Conversion[/-][+]CWG2958 [over.ics.rank] Incorrect example of overload resolution with qualification conversion[/+]on Jun 11, 2025
Activity
jensmaurer commentedon Nov 10, 2024
I think fixing the example is not what we want. Instead, we want the normative words to reflect the intent expressed in the example.
t3nsor commentedon Nov 11, 2024
I think we could just borrow the "excluding any lvalue transformation" wording from p3.2.1.
jensmaurer commentedon Nov 11, 2024
CWG2958
[-][over.ics.rank] Incorrect Example of Overload Resolution with Qualification Conversion[/-][+]CWG2958 [over.ics.rank] Incorrect Example of Overload Resolution with Qualification Conversion[/+][-]CWG2958 [over.ics.rank] Incorrect Example of Overload Resolution with Qualification Conversion[/-][+]CWG2958 [over.ics.rank] Incorrect example of overload resolution with qualification conversion[/+]