]> granicus.if.org Git - clang/commit
[Sema] Patch to issue warning on comparing parameters with
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)
commit9699ab445ae007a5a6b32981da73baed77600671
tree50d9e8000322e3bb7d74fbc7bfd11aea4bd51646
parentad6b92ee522bfad460be26ef29eb509e16902202
[Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning  when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222264 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/ScopeInfo.h
lib/Sema/ScopeInfo.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaExpr.cpp
test/Sema/nonnull.c