diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2015-12-08 22:02:00 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2015-12-08 22:02:00 +0000 |
commit | 850269a47eed94efc2620dde5fa7473e9d6bab9a (patch) | |
tree | b4d318b3488f3db333f905327a1f2690091e075e /clang/lib/Frontend/TestModuleFileExtension.cpp | |
parent | 297916273244b8877631027b68a8911b737bb47b (diff) | |
download | bcm5719-llvm-850269a47eed94efc2620dde5fa7473e9d6bab9a.tar.gz bcm5719-llvm-850269a47eed94efc2620dde5fa7473e9d6bab9a.zip |
[Sema] Add warning when comparing nonnull and null
Currently, we emit warnings in some cases where nonnull function
parameters are compared against null. This patch extends this support
to warn when comparing the result of `returns_nonnull` functions
against null.
More specifically, we will now warn cases like:
int *foo() __attribute__((returns_nonnull));
int main() {
if (foo() == NULL) {} // warning: will always evaluate to false
}
Differential Revision: http://reviews.llvm.org/D15324
llvm-svn: 255058
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions