This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 22 Mar 2015 19:46:43 +0000
- Subject: [Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer
- Auto-submitted: auto-generated
- References: <bug-65168-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168
--- Comment #10 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #9)
> > What about "the address of the object bound to 'r' may be assumed to always
> > convert to true"?
>
> Why only warn about references, and not also for int i; bool b = !&i; ?
We already do:
/home/manuel/test.c:3:21: warning: the address of âiâ will always evaluate as
âtrueâ [-Waddress]
int i; bool b = !&i;
^