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++/81928] if(!this) optimization leads to possible errors without warnings


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).

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