[PATCH] Allow (Object *)kMyGlobalCFObjc casts without bridging

Ben Langmuir blangmuir at apple.com
Tue Feb 24 11:14:56 PST 2015


Hi John,

As we discussed: 

Allow (Object *)kMyGlobalCFObj casts without bridging
    
Previously we allowed these casts only for constants declared in system
headers, which we assume are retain/release-neutral. Now also allow them
for constants in user headers, treating them as +0.  Practically, this
means that we will now allow:
id x = (id)kMyGlobalConst;
    
But unlike with system headers we cannot mix them with +1 values:
id y = (id)(b ? kMyGlobalConst : [Obj newValAtPlusOne]); // error
id z = (id)(b ? kSystemGlobalConst: [Obj newValAtPlusOne]); // OK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: extern-global-const-unbridged-cast.patch
Type: application/octet-stream
Size: 9335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150224/5d45ac9b/attachment.obj>


More information about the cfe-commits mailing list