From: Eli Friedman Date: Wed, 25 Feb 2009 04:20:42 +0000 (+0000) Subject: Minor cleanup for IntToBlockPointer so it applies to all callers of X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d8f4f4330031f893b647662bd5ff1b9ae3da694f;p=clang Minor cleanup for IntToBlockPointer so it applies to all callers of Sema::CheckAssignmentConstraints; not really visible, but the right thing to do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65428 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index a58752cb42..174e408ead 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -2696,7 +2696,7 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) { if (isa(lhsType)) { if (rhsType->isIntegerType()) - return IntToPointer; + return IntToBlockPointer; // Treat block pointers as objects. if (getLangOptions().ObjC1 && @@ -2765,10 +2765,6 @@ Sema::CheckSingleAssignmentConstraints(QualType lhsType, Expr *&rExpr) { return Compatible; } - // We don't allow conversion of non-null-pointer constants to integers. - if (lhsType->isBlockPointerType() && rExpr->getType()->isIntegerType()) - return IntToBlockPointer; - // This check seems unnatural, however it is necessary to ensure the proper // conversion of functions/arrays. If the conversion were done for all // DeclExpr's (created by ActOnIdentifierExpr), it would mess up the unary