diff options
| author | Richard Trieu <rtrieu@google.com> | 2014-02-26 02:36:06 +0000 |
|---|---|---|
| committer | Richard Trieu <rtrieu@google.com> | 2014-02-26 02:36:06 +0000 |
| commit | 2a66e6e50046e6b9ae048f114ad4fec23011e93c (patch) | |
| tree | 6c3d809f806b0d53a9c0a9ed9946a2f674cfef53 /lib/Basic/FileSystemStatCache.cpp | |
| parent | e1805368a8a09000b3be70b50e20522efb78581e (diff) | |
| download | clang-2a66e6e50046e6b9ae048f114ad4fec23011e93c.tar.gz clang-2a66e6e50046e6b9ae048f114ad4fec23011e93c.tar.bz2 clang-2a66e6e50046e6b9ae048f114ad4fec23011e93c.tar.xz | |
PR16074, implement warnings to catch pointer to boolean true and pointer to
null comparison when the pointer is known to be non-null.
This catches the array to pointer decay, function to pointer decay and
address of variables. This does not catch address of function since this
has been previously used to silence a warning.
Pointer to bool conversion is under -Wbool-conversion.
Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group
of -Wtautological-compare.
void foo() {
int arr[5];
int x;
// warn on these conditionals
if (foo);
if (arr);
if (&x);
if (foo == null);
if (arr == null);
if (&x == null);
if (&foo); // no warning
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/FileSystemStatCache.cpp')
0 files changed, 0 insertions, 0 deletions
