The following two defaulted equality comparison operators with explicit object parameter
struct A {
// #1 valid but rejected in Clang
//bool operator ==(this A, A) = default;
// #2 invalid but accepted in Clang
bool operator ==(this const A, const A &) = default;
};
are processed incorrectly by Clang. 1 is valid but rejected in Clang. 2 is invalid but accepted in Clang. Online demo: https://gcc.godbolt.org/z/MxMnK187c
The following two defaulted equality comparison operators with explicit object parameter
```
struct A {
// #1 valid but rejected in Clang
//bool operator ==(this A, A) = default;
// #2 invalid but accepted in Clang
bool operator ==(this const A, const A &) = default;
};
```
are processed incorrectly by Clang. 1 is valid but rejected in Clang. 2 is invalid but accepted in Clang. Online demo: https://gcc.godbolt.org/z/MxMnK187c
Related discussion: https://stackoverflow.com/q/78808689/7325599
The following two defaulted equality comparison operators with explicit object parameter
are processed incorrectly by Clang. 1 is valid but rejected in Clang. 2 is invalid but accepted in Clang. Online demo: https://gcc.godbolt.org/z/MxMnK187c
Related discussion: https://stackoverflow.com/q/78808689/7325599