]> granicus.if.org Git - clang/commit
Extend tautological pointer compare and pointer to bool conversion warnings to
authorRichard Trieu <rtrieu@google.com>
Fri, 8 Aug 2014 22:41:43 +0000 (22:41 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 8 Aug 2014 22:41:43 +0000 (22:41 +0000)
commit01ad089bc379bfce98047c6f7be002efa3a40636
tree6477569c61dcc7224d162995c098f373ff28ce3a
parent6149524f3a8917ec09537b097bef907a2ce5ee40
Extend tautological pointer compare and pointer to bool conversion warnings to
macro arguments.

Previously, these warnings skipped any code in a macro expansion.  Preform an
additional check and warn when the expression and context locations are both
in the macro argument.

The most obvious case not caught is passing a pointer directly to a macro,
i.e 'assert(&array)' but 'assert(&array && "valid array")' is caught.  This is
because macro arguments are not typed and the conversion happens inside the
macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215251 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/SemaCXX/warn-bool-conversion.cpp
test/SemaCXX/warn-tautological-compare.cpp
test/SemaCXX/warn-tautological-undefined-compare.cpp
test/SemaCXX/warn-undefined-bool-conversion.cpp