llvm-project/clang/test/SemaCXX/Inputs
Roman Lebedev 809df34efc [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.
Summary:
The warning was initially introduced in D32914 by @thakis,
and the concerns were raised there, and later in rL302247
and PR33771.

I do believe that it makes sense to relax the diagnostic
e.g. in this case, when the expression originates from the
system header, which can not be modified. This prevents
adoption for the diagnostic for codebases which use pthreads
(`PTHREAD_MUTEX_INITIALIZER`), gtest, etc.

As @malcolm.parsons suggests, it *may* make sense to also
not warn for the template types, but it is not obvious to
me how to do that in here.

Though, it still makes sense to complain about `NULL` macro.

While there, add more tests.

Reviewers: dblaikie, thakis, rsmith, rjmccall, aaron.ballman

Reviewed By: thakis

Subscribers: Rakete1111, hans, cfe-commits, thakis, malcolm.parsons

Tags: #clang

Differential Revision: https://reviews.llvm.org/D38954

llvm-svn: 316662
2017-10-26 13:18:14 +00:00
..
array-bounds-system-header.h
header-with-pragma-optimize-off.h
malloc.h
nullability-completeness.h Do not issue -Wnullability-completeness for dependent types that are not written as pointer types. 2017-05-19 20:20:13 +00:00
override-system-header.h
register.h
std-coroutine.h
warn-new-overaligned-3.h
warn-unused-variables.h
warn-zero-nullptr.h [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL. 2017-10-26 13:18:14 +00:00