forked from OSchip/llvm-project
3bb8b56a5d
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 } llvm-svn: 202216 |
||
---|---|---|
.. | ||
expr.ass | ||
expr.cast | ||
expr.const | ||
expr.mptr.oper | ||
expr.post | ||
expr.prim | ||
expr.unary | ||
p3.cpp | ||
p8.cpp | ||
p9.cpp | ||
p10-0x.cpp |