Exclude calls to variadic lambda stubs from -Wnonnull checking (PR c++/95984).
authorMartin Sebor <msebor@redhat.com>
Mon, 6 Jul 2020 21:23:37 +0000 (15:23 -0600)
committerMartin Sebor <msebor@redhat.com>
Mon, 6 Jul 2020 21:23:37 +0000 (15:23 -0600)
commit67a493a0b9e7ce6caba4b8bedf1f3295e477ec00
tree952e9ccb0ffa2e3f8c2e190f2cdc389a2085e2b8
parent6e1c9715b3142bc09e313c0d4b196694ab7ae153
Exclude calls to variadic lambda stubs from -Wnonnull checking (PR c++/95984).

Resolves:
PR c++/95984 - Internal compiler error: Error reporting routines re-entered in -Wnonnull on a variadic lamnda
PR c++/96021 - missing -Wnonnull passing nullptr to a nonnull variadic lambda

gcc/c-family/ChangeLog:

PR c++/95984
* c-common.c (check_function_nonnull): Avoid checking syntesized calls
to stub lambda objects with null this pointer.
(check_nonnull_arg): Handle C++ nullptr.

gcc/cp/ChangeLog:

PR c++/95984
* call.c (build_over_call): Check calls only when tf_warning is set.

gcc/testsuite/ChangeLog:

PR c++/95984
* g++.dg/warn/Wnonnull6.C: New test.
gcc/c-family/c-common.c
gcc/cp/call.c
gcc/testsuite/g++.dg/warn/Wnonnull6.C [new file with mode: 0644]