I found out recently that clang has a '-Wunused-private-field' warning. E.g., I got: https://github.com/mozilla/rr/pull/1757#issuecomment-237031428 I think it would be good to add this to gcc.
Confirming as an enhancement.
*** Bug 87409 has been marked as a duplicate of this bug. ***
Working on a patch adding the option `-Wunused-private-field`.
I have implemented `-Wunused-private-field`. However, it looks like g++ doesn't currently track whether a field is used or not, meaning that the option is useless. Am I missing something?
A [patch](https://gcc.gnu.org/pipermail/gcc-patches/2026-March/711320.html) has been sent.