]> granicus.if.org Git - clang/commitdiff
Minor cleanup for IntToBlockPointer so it applies to all callers of
authorEli Friedman <eli.friedman@gmail.com>
Wed, 25 Feb 2009 04:20:42 +0000 (04:20 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Wed, 25 Feb 2009 04:20:42 +0000 (04:20 +0000)
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

lib/Sema/SemaExpr.cpp

index a58752cb42a7b5f067b76a7ba9306b50eeccdf70..174e408ead460ef613ca1605f45d575e9c08bd52 100644 (file)
@@ -2696,7 +2696,7 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
 
   if (isa<BlockPointerType>(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