This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81250] C++ warnings about unused stl


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]