[llvm-bugs] [Bug 26684] New: False-positive with CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION and operator ?:

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 21 17:05:03 PST 2016


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

            Bug ID: 26684
           Summary: False-positive with
                    CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION and operator
                    ?:
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: coeur at gmx.fr
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following code produces a false-positive warning with
CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION:

        NSString * _Nullable a = nil;
        NSString * _Nonnull b = @"";
        NSString * _Nonnull c = a ?: b;

For nullability, Clang should only check the right member of operator `?:`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160222/fe4c0622/attachment.html>


More information about the llvm-bugs mailing list