This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81250] C++ warnings about unused stl
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Jun 2017 21:00:48 +0000
- Subject: [Bug c++/81250] C++ warnings about unused stl
- Auto-submitted: auto-generated
- References: <bug-81250-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81250
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Right, we intentionally don't warn for unused variables with non-trivial
destructors, because the destructor could be doing something useful (like
logging that a scope was exited, or committing a "transaction" of some kind
when leaving the scope). If the destructor does something then the object is
"used", because whether it exists or not has side effects.