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&)