This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82008] nonnull attribute and multiple inheritance
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 18:59:09 +0000
- Subject: [Bug c++/82008] nonnull attribute and multiple inheritance
- Auto-submitted: auto-generated
- References: <bug-82008-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82008
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-08-29
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The upcast to the base class requires adjustment if the pointer is non-null, so
the GIMPLE for the call is funcyyy (d != 0B ? &d->D.2287 : 0B). This triggers
the warning.
Either we shouldn't warn here, because the null argument is emitted by the
compiler not the user code, or we should optimize based on the nonnull
attribute to perform the adjustment unconditionally: funcyyy (&d->D.2287)