]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: disable -Wnonnull in unevaluated context [PR115580]
authorMarek Polacek <polacek@redhat.com>
Tue, 4 Mar 2025 18:07:27 +0000 (13:07 -0500)
committerMarek Polacek <polacek@redhat.com>
Wed, 5 Mar 2025 21:03:30 +0000 (16:03 -0500)
commit459c8a55567b06522e4b9cc0a4ef62f9d3024526
tree0b1917184ad1b536949170a7dc01759befeb173c
parent24ea4539300d4926d9f073822e68f0d2f369452d
c++: disable -Wnonnull in unevaluated context [PR115580]

This PR complains that we issue a -Wnonnull even in a decltype.
This fix disables even -Wformat and -Wrestrict.  I think that's fine.

PR c++/115580

gcc/c-family/ChangeLog:

* c-common.cc (check_function_arguments): Return early if
c_inhibit_evaluation_warnings.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wnonnull16.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/c-family/c-common.cc
gcc/testsuite/g++.dg/warn/Wnonnull16.C [new file with mode: 0644]