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
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&)
The text was updated successfully, but these errors were encountered:
jensmaurer
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
Nov 11, 2024
Full name of submitter: Vincent X
Reference: [over.ics.rank]
Issue description: In Example 5:
(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:
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:
The text was updated successfully, but these errors were encountered: