On Apr 5, 2010, at 5:05 PM, Ted Kremenek wrote:

On Apr 1, 2010, at 12:50 PM, Fariborz Jahanian wrote:

Author: fjahanian
Date: Thu Apr  1 14:50:22 2010
New Revision: 100129

URL: http://llvm.org/viewvc/llvm-project?rev=100129&view=rev
Log:
Relax the typesafty rules of block pointers types which
take'id' or return 'id' in their type. Fixes radar 7814131.

Modified:
   cfe/trunk/lib/AST/ASTContext.cpp
   cfe/trunk/test/SemaObjC/block-type-safety.m

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=100129&r1=100128&r2=100129&view=diff
=
=
=
=
=
=
=
=
=
=====================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Apr  1 14:50:22 2010
@@ -4136,14 +4136,15 @@
bool ASTContext::canAssignObjCInterfacesInBlockPointer(
const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT) {
-  if (RHSOPT->isObjCBuiltinType())
+  if (RHSOPT->isObjCBuiltinType() ||
+      LHSOPT->isObjCIdType() || LHSOPT->isObjCQualifiedIdType())
    return true;

Hi Fariborz,

I understand adding 'LHSOpt->isObjCIdType()', but not the 'LHSOpt- >isObjCQualifiedIdType()'. Is this really what we want? Doesn't this mean that we unconditionally accept the assignment, even if the RHS doesn't conform to the specified protocols?

My bad. Fixed in TOT: 
http://llvm.org/viewvc/llvm-project?view=rev&revision=100533

- Fariborz


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to