Emit -Waddress warnings for comparing address of reference against NULL
authorPatrick Palka <ppalka@gcc.gnu.org>
Sat, 13 Jun 2015 16:11:15 +0000 (16:11 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Sat, 13 Jun 2015 16:11:15 +0000 (16:11 +0000)
commit076fecad0db4fb76524af6785b146491d4060dd4
treee76304d58d1deaf94d7fd2dc50a09d6c2979c651
parent313d38e359bfcd8b56c946233294061c66ae21dc
Emit -Waddress warnings for comparing address of reference against NULL

gcc/c-family/ChangeLog:

PR c++/65168
* c-common.c (c_common_truthvalue_conversion): Warn when
converting an address of a reference to a truth value.

gcc/cp/ChangeLog:

PR c++/65168
* typeck.c (cp_build_binary_op): Warn when comparing an address
of a reference against NULL.

gcc/testsuite/ChangeLog:

PR c++/65168
g++.dg/warn/Walways-true-3.C: New test.

From-SVN: r224455
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Walways-true-3.C [new file with mode: 0644]