[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2016-07-20 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #16 from Jason Merrill --- Author: jason Date: Thu Jul 21 06:05:39 2016 New Revision: 238560 URL: https://gcc.gnu.org/viewcvs?rev=238560&root=gcc&view=rev Log: PR c++/65168 - -Waddress in unevaluated context. gcc/c-family/

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-06-15 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 Patrick Palka changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-06-15 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 Manuel López-Ibáñez changed: What|Removed |Added Status|ASSIGNED|NEW CC|

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-06-13 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #13 from Patrick Palka --- Author: ppalka Date: Sat Jun 13 16:11:15 2015 New Revision: 224455 URL: https://gcc.gnu.org/viewcvs?rev=224455&root=gcc&view=rev Log: Emit -Waddress warnings for comparing address of reference against NULL

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-23 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 Paolo Carlini changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned a

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #12 from Manuel López-Ibáñez --- (In reply to Jonathan Wakely from comment #11) > Great, then my suggestion would be to use exactly the same wording for > references. I guess the Clang devs added their wording because someone mistake

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #11 from Jonathan Wakely --- Great, then my suggestion would be to use exactly the same wording for references.

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #10 from Manuel López-Ibáñez --- (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

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #9 from Jonathan Wakely --- (In reply to Manuel López-Ibáñez from comment #8) > Sure, I was trying to make the Clang message a bit more understandable. I > got completely confused by "pointer may be assumed to always convert to > true

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #8 from Manuel López-Ibáñez --- (In reply to Jonathan Wakely from comment #7) > The diagnostic needs rewording, &r is not the address of a reference, it's > the address of whatever the reference is bound to. Please don't add > diagnos

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #7 from Jonathan Wakely --- The diagnostic needs rewording, &r is not the address of a reference, it's the address of whatever the reference is bound to. Please don't add diagnostics that talk about something that has no meaning in th

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 Manuel López-Ibáñez changed: What|Removed |Added Keywords||patch CC|

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread jan.kratochvil at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #5 from Jan Kratochvil --- (In reply to Manuel López-Ibáñez from comment #3) > Does this patch work in your real-world code? There were just many tests like: if (!&r) return 0; So it should really work, thanks.

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #4 from Manuel López-Ibáñez --- Or even: int fii(int p) { int &r=p; return !&r; }

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #3 from Manuel López-Ibáñez --- I got confused by Clang's message. The problem is not the pointer or NULL. The problem is converting the address of a reference to bool: int fii(int *p) { int &r=*p; return !&r; } This is trivial

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread jan.kratochvil at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 --- Comment #2 from Jan Kratochvil --- It should check the '!&r' condition which makes no sense. The variable initialization in real world programs is too complicated to be able to figure out it may be NULL.

[Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer

2015-03-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168 Manuel López-Ibáñez changed: What|Removed |Added Target|x86_64-linux-gnu| Status|UNCONFIRMED