-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
CWGCoreCore
Description
There are special rules around rewritten operator candidates that make the following example well-formed, because the example appears in existing code bases:
struct B {
bool operator==(const B&);
};
struct C : B {
C();
C(B);
bool operator!=(const B&);
};
bool c1 = B() == C(); // should be OK
Due to unrelated changes, the current wording makes this example ill-formed (because the two member operators have different object parameter types). This was not intended.
While fixing this, should the special rules be extended to also cover member operators with explicit object parameters? It seems unlikely that a new feature such as explicit object parameters would appear in a code base that also uses rather baroque combinations of comparison operators.
See CWG2797 for more details.