Thanks Fariborz.  After reading your comment, is this patch enough?  This is 
safe *only* when the original property is declared readonly.  If the original 
property is declared readwrite, then this isn't safe.  In other words, readonly 
overridden by readwrite is ok, readwrite overridden by readwrite (with a 
different type) is NOT ok.  Does this patch guard for this case?

On Feb 2, 2012, at 11:34 AM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Thu Feb  2 13:34:05 2012
> New Revision: 149625
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=149625&view=rev
> Log:
> objc: comment the code which allows narroing of property object
> type in continuation class.
> 
> Modified:
>    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
> 
> Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=149625&r1=149624&r2=149625&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Thu Feb  2 13:34:05 2012
> @@ -279,6 +279,9 @@
>   if (!Context.hasSameType(PIDecl->getType(), PDecl->getType())) {
>     bool IncompatibleObjC = false;
>     QualType ConvertedType;
> +    // Relax the strict type matching for property type in continuation 
> class.
> +    // Allow property object type of continuation class to be different as 
> long
> +    // as it narrows the object type in its primary class property.
>     if (!isa<ObjCObjectPointerType>(PIDecl->getType()) ||
>         !isa<ObjCObjectPointerType>(PDecl->getType()) ||
>         (!isObjCPointerConversion(PDecl->getType(), PIDecl->getType(), 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

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

Reply via email to