https://bugs.llvm.org/show_bug.cgi?id=33280

            Bug ID: 33280
           Summary: Add strict checker for nullability
           Product: clang
           Version: 4.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

The _Nonnull and _Nullable annotations seem mainly focused on preventing the
literal "nil" being passed into a method or set for a nonnull property.
However, this is much more relaxed than Swift's null checking. It would be
great if we could statically analyze if what was being passed in as a nonnull
parameter was nonnull itself. It could recognize if a nullable variable was
being used in a way that made it nonnull.

For example:
if (!x) {
  return;
}
[self runWithNonnullArg:x];

or

[self runWithNonnullArg:(x ?: @"")];

Both of these would be pass the static analysis.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to