This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81928] if(!this) optimization leads to possible errors without warnings
- From: "matthieu.brucher at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Aug 2017 20:08:45 +0000
- Subject: [Bug c++/81928] if(!this) optimization leads to possible errors without warnings
- Auto-submitted: auto-generated
- References: <bug-81928-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81928
--- Comment #15 from Matthieu Brucher <matthieu.brucher at gmail dot com> ---
Thanks, finally something relevant, yes it's a bug that can be easilly checked
by gcc and that GCC can easilly warn about. (lowering the bar here). Yes, the
user should chase the bug because they screwep on a monumental level. But why
can't gcc warn that the user is about to do something stupid or tell them that
the comparison is always true?
Of course, if there is a warning level that already does that, my comment is
moot (although making it a higher level warning may help).