This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79961] Should diagnose when '__nonnull__' attribute is applied to implicit this argument
- From: "palves at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Mar 2017 00:50:33 +0000
- Subject: [Bug c++/79961] Should diagnose when '__nonnull__' attribute is applied to implicit this argument
- Auto-submitted: auto-generated
- References: <bug-79961-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79961
--- Comment #9 from Pedro Alves <palves at redhat dot com> ---
> ((A*)0)->g (p)
This is undefined behavior. We forced the world to fix code like that in the
GCC 6 release cycle: https://gcc.gnu.org/gcc-6/changes.html
At best, I'd suggest degrading the error on implicit this nonnull(1) to a
warning iff compiling with -fno-delete-null-pointer-checks. But I don't think
we really should need to cater to that. FWIW.