]> granicus.if.org Git - clang/commit
[analyzer] Nullability: Don't warn along paths where null returned from non-null.
authorDevin Coughlin <dcoughlin@apple.com>
Mon, 28 Mar 2016 20:30:25 +0000 (20:30 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Mon, 28 Mar 2016 20:30:25 +0000 (20:30 +0000)
commit029eb2219ef2ed847e8fcd860070d239a5a8273b
tree19ba4dbf40fb60f3cc18267b6f41a1905a807216
parent37bbc60dcc8ac96aec984be96d16295b3716d8ec
[analyzer] Nullability: Don't warn along paths where null returned from non-null.

Change the nullability checker to not warn along paths where null is returned from
a method with a non-null return type, even when the diagnostic for this return
has been suppressed. This prevents warning from methods with non-null return types
that inline methods that themselves return nil but that suppressed the diagnostic.

Also change the PreconditionViolated state component to be called "InvariantViolated"
because it is set when a post-condition is violated, as well.

rdar://problem/25393539

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264647 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
test/Analysis/Inputs/system-header-simulator-for-nullability.h
test/Analysis/nullability-no-arc.mm