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

Steve Naroff snaroff at apple.com
Mon Sep 29 17:24:17 PDT 2008


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);





More information about the cfe-commits mailing list