Closed
Description
Observed:
class A {
int used;
bool operator==(const A&) const;
};
bool A::operator==(const A&) const = default;
class B {
int used;
friend bool operator==(const B&, const B&);
};
bool operator==(const B&, const B&) = default;
clang++ -std=c++20 -Wunused-private-field test.cpp
<source>:2:7: warning: private field 'used' is not used [-Wunused-private-field]
2 | int used;
| ^
1 warning generated.
Compiler returned: 0
Exptected:
No warnings.