Skip to content
Snippets Groups Projects
  • Ben Langmuir's avatar
    b378995a
    Allow (Object *)kMyGlobalCFObj casts without bridging · b378995a
    Ben Langmuir authored
    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
    
    Thanks to John for suggesting this improvement.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230534 91177308-0d34-0410-b5e6-96231b3b80d8
    b378995a
    History
    Allow (Object *)kMyGlobalCFObj casts without bridging
    Ben Langmuir authored
    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
    
    Thanks to John for suggesting this improvement.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230534 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.