[Bug c++/55203] No unused warning for variables of non-trivial types

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Feb 18 00:54:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55203

--- Comment #15 from Martin Sebor <msebor at gcc dot gnu.org> ---
The core bits of this feature are in place but the std::string test case is
still not diagnosed because string has non-trivial ctor and dtor and isn't
decorated using the warn_unused attribute.

Jonathan, what's the next step?  It sounds as though you don't think decorating
nearly every libstdc++ class makes sense.  Should -Wunused be tweaked to
diagnose unused variables of all types and let users deal with the fallout for
RAII classes by decorating then with attribute unused?  Or close this bug as
resolved?


More information about the Gcc-bugs mailing list