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 #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

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