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++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer


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;
                     ^

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