]> granicus.if.org Git - clang/commitdiff
Don't complain about block pointer to void* conversions
authorDouglas Gregor <dgregor@apple.com>
Thu, 27 Nov 2008 00:44:28 +0000 (00:44 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 27 Nov 2008 00:44:28 +0000 (00:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60138 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp

index 614e4873bacc092eeeacaf1e0865031557dbf0e3..57caa6ecf24e8f06a58b4ea46eef82de9b2b1428 100644 (file)
@@ -1166,10 +1166,6 @@ public:
     /// pointers types that are not compatible.
     IncompatibleBlockPointer,
     
-    /// BlockVoidPointer - The assignment is between a block pointer and
-    /// void*, we accept for now.
-    BlockVoidPointer,
-    
     /// IncompatibleObjCQualifiedId - The assignment is between a qualified
     /// id type and something else (that is incompatible with it). For example,
     /// "id <XXX>" = "Foo *", where "Foo *" doesn't implement the XXX protocol.
index b22ae7d1f2bd265b55e8567eebb318bf44b2efbc..e21047e10d8f2c65f068426e45d249a663c989c4 100644 (file)
@@ -1917,7 +1917,7 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
       
     if (rhsType->getAsBlockPointerType()) {
       if (lhsType->getAsPointerType()->getPointeeType()->isVoidType())
-        return BlockVoidPointer;
+        return Compatible;
 
       // Treat block pointers as objects.
       if (getLangOptions().ObjC1 &&
@@ -1941,7 +1941,7 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
       
     if (const PointerType *RHSPT = rhsType->getAsPointerType()) {
       if (RHSPT->getPointeeType()->isVoidType())
-        return BlockVoidPointer;
+        return Compatible;
     }
     return Incompatible;
   }
@@ -1959,7 +1959,7 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
       
     if (isa<BlockPointerType>(lhsType) && 
         rhsType->getAsPointerType()->getPointeeType()->isVoidType())
-      return BlockVoidPointer;
+      return Compatible;
     return Incompatible;
   }
 
@@ -3646,9 +3646,6 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
   case IncompatibleBlockPointer:
     DiagKind = diag::ext_typecheck_convert_incompatible_block_pointer;
     break;
-  case BlockVoidPointer:
-    DiagKind = diag::ext_typecheck_convert_pointer_void_block;
-    break;
   case IncompatibleObjCQualifiedId:
     // FIXME: Diagnose the problem in ObjCQualifiedIdTypesAreCompatible, since 
     // it can give a more specific diagnostic.