[Bug c++/71904] comparing this to NULL should give a warning by default (this == NULL)
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jul 17 11:01:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71904
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |6.0
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We already warn:
prog.cc: In member function 'void A::test()':
prog.cc:3:21: warning: nonnull argument 'this' compared to NULL
[-Wnonnull-compare]
void test(void) { if (this == 0) bar();}
^~
More information about the Gcc-bugs
mailing list