[cfe-commits] r149007 - in /cfe/trunk: lib/AST/ASTContext.cpp test/SemaObjC/block-id-as-block-argtype.m

Eli Friedman eli.friedman at gmail.com
Wed Jan 25 17:36:47 PST 2012


On Wed, Jan 25, 2012 at 4:45 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
> Author: fjahanian
> Date: Wed Jan 25 18:45:38 2012
> New Revision: 149007
>
> URL: http://llvm.org/viewvc/llvm-project?rev=149007&view=rev
> Log:
> objc: allow block pointer matching 'id' type when
> they show up as argument types of two block pointers.
> // rdar://10734265
>
> Added:
>    cfe/trunk/test/SemaObjC/block-id-as-block-argtype.m
> Modified:
>    cfe/trunk/lib/AST/ASTContext.cpp
>
> Modified: cfe/trunk/lib/AST/ASTContext.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=149007&r1=149006&r2=149007&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/ASTContext.cpp (original)
> +++ cfe/trunk/lib/AST/ASTContext.cpp Wed Jan 25 18:45:38 2012
> @@ -5933,7 +5933,11 @@
>       if (ETy->getDecl()->getIntegerType() == LHSCan.getUnqualifiedType())
>         return LHS;
>     }
> -
> +    // allow block pointer type to match an 'id' type.
> +    if (OfBlockPointer && !BlockReturnType &&
> +        LHS->isObjCIdType() && RHS->isBlockPointerType())
> +      return LHS;

mergeTypes is supposed to be symmetrical; please fix this check so it
is symmetrical as well.

-Eli




More information about the cfe-commits mailing list