[LLVMbugs] [Bug 14062] New: ObjC BOOL literal becomes integer NSNumber when boxed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 10 23:45:07 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=14062

             Bug #: 14062
           Summary: ObjC BOOL literal becomes integer NSNumber when boxed
           Product: new-bugs
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: netshroud at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9332
  --> http://llvm.org/bugs/attachment.cgi?id=9332
Demonstration source file

When using a boxed expression on a BOOL literal (i.e. @(YES) or @(NO) ), an
integer-type NSNumber is returned instead of a boolean-type NSNumber.

I'm not sure if it's a bug on the 'true' and 'false' boxed booleans, but it
should definitely behave as a boolean for YES and NO.

You can see this behaviour by converting it to JSON. The attached demo file can
be compiled with, assuming a default Xcode installation:

xcrun clang main.m -framework Foundation -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/
&& ./a.out

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list