<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 1, 2010, at 12:50 PM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Author: fjahanian<br>Date: Thu Apr  1 14:50:22 2010<br>New Revision: 100129<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=100129&view=rev">http://llvm.org/viewvc/llvm-project?rev=100129&view=rev</a><br>Log:<br>Relax the typesafty rules of block pointers types which<br>take'id' or return 'id' in their type. Fixes radar 7814131.<br><br>Modified:<br>   cfe/trunk/lib/AST/ASTContext.cpp<br>   cfe/trunk/test/SemaObjC/block-type-safety.m<br><br>Modified: cfe/trunk/lib/AST/ASTContext.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=100129&r1=100128&r2=100129&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=100129&r1=100128&r2=100129&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/ASTContext.cpp (original)<br>+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Apr  1 14:50:22 2010<br>@@ -4136,14 +4136,15 @@<br>bool ASTContext::canAssignObjCInterfacesInBlockPointer(<br>                                         const ObjCObjectPointerType *LHSOPT,<br>                                         const ObjCObjectPointerType *RHSOPT) {<br>-  if (RHSOPT->isObjCBuiltinType())<br>+  if (RHSOPT->isObjCBuiltinType() ||<span class="Apple-converted-space"> </span><br>+      LHSOPT->isObjCIdType() || LHSOPT->isObjCQualifiedIdType())<br>    return true;<br></span></blockquote><div><br></div><div>Hi Fariborz,</div><div><br></div><div>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?</div><div><br></div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br>  if (LHSOPT->isObjCBuiltinType()) {<br>    return RHSOPT->isObjCBuiltinType() || RHSOPT->isObjCQualifiedIdType();<br>  }<br><br>-  if (LHSOPT->isObjCQualifiedIdType() || RHSOPT->isObjCQualifiedIdType())<br>+  if (RHSOPT->isObjCQualifiedIdType())<br>    return ObjCQualifiedIdTypesAreCompatible(QualType(LHSOPT,0),<br>                                             QualType(RHSOPT,0),<br>                                             false);<br></span></blockquote></div><br></body></html>