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: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Jul 2016 06:06:11 +0000
- Subject: [Bug c++/65168] diagnostic: missing: reference cannot be bound to dereferenced null pointer
- Auto-submitted: auto-generated
- References: <bug-65168-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65168
--- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> ---
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/
* c-common.c (c_common_truthvalue_conversion): Check
c_inhibit_evaluation_warnings for warning about address of
reference.
gcc/cp/
* typeck.c (cp_truthvalue_conversion): Compare pointers to nullptr.
Don't set c_inhibit_evaluation_warnings.
Added:
trunk/gcc/testsuite/g++.dg/warn/Waddress-3.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/g++.dg/warn/Walways-true-1.C
trunk/gcc/testsuite/g++.dg/warn/Walways-true-2.C