Closed
Description
clang version: 19.1
os: ubuntu 22.04
class A
{
public:
A() : m_x(0)
{
}
private:
const int m_x;
};
#ifdef BUG
class C
{
friend auto operator==(C, C) -> bool = default;
};
#endif
int main()
{
[[maybe_unused]] auto c = A();
}
clang++ -std=c++20 -Wall main.cpp
main.cpp:8:14: warning: private field 'm_x' is not used [-Wunused-private-field]
8 | const int m_x;
| ^
1 warning generated.
clang++ -DBUG -std=c++20 -Wall main.cpp
no warnings