[cfe-commits] r56821 - /cfe/trunk/lib/Sema/SemaDeclObjC.cpp

Daniel Dunbar daniel at zuster.org
Mon Sep 29 17:47:14 PDT 2008


Shouldn't this only be allowed for readonly properties?

 - Daniel

On Mon, Sep 29, 2008 at 5:24 PM, Steve Naroff <snaroff at apple.com> wrote:
> Author: snaroff
> Date: Mon Sep 29 19:24:17 2008
> New Revision: 56821
>
> URL: http://llvm.org/viewvc/llvm-project?rev=56821&view=rev
> Log:
> Fix <rdar://problem/6247781> Parser rejecting properly mismatched properties.
>
> Modified:
>    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=56821&r1=56820&r2=56821&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Sep 29 19:24:17 2008
> @@ -1254,14 +1254,14 @@
>            PropertyId->getName());
>       return 0;
>     }
> -    // Check that type of property and its ivar match.
> -    if (Context.getCanonicalType(Ivar->getType()) !=
> -        Context.getCanonicalType(property->getType())) {
> +    // Check that type of property and its ivar are type compatible.
> +    // A property is allowed to be a sub-class of the instance variable type.
> +    if (CheckAssignmentConstraints(property->getType(),
> +                                   Ivar->getType()) != Compatible) {
>       Diag(PropertyLoc, diag::error_property_ivar_type, property->getName(),
>            Ivar->getName());
>       return 0;
>     }
> -
>   } else if (PropertyIvar) {
>     // @dynamic
>     Diag(PropertyLoc, diag::error_dynamic_property_ivar_decl);
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list