DIAG(warn_property_attribute, WARNING,
"property '%0' '%1' attribute does not match super class '%2' "
"property")
+DIAG(warn_property_type, WARNING,
+ "property type '%0' does not match super class '%1' property type")
//===----------------------------------------------------------------------===//
// Semantic Analysis
Property->getName(), "getter", SuperIDecl->getName(),
SourceRange());
- if (Property->getCanonicalType() != SuperProperty->getCanonicalType()) {
- if ((CAttr & ObjCPropertyDecl::OBJC_PR_readonly)
- && (SAttr & ObjCPropertyDecl::OBJC_PR_readonly))
- // && objc_compare_types(...))
- ;
- else
- ; //
- }
+ if (Property->getCanonicalType() != SuperProperty->getCanonicalType())
+ Diag(Property->getLocation(), diag::warn_property_type,
+ Property->getType().getAsString(),
+ SuperIDecl->getName());
}
--- /dev/null
+// RUN: clang -verify %s
+
+@interface I
+{
+ id d1;
+}
+@property (readwrite, copy) id d1;
+@property (readwrite, copy) id d2;
+@end
+
+@interface NOW : I
+@property (readonly, retain) id d1; // expected-warning {{attribute 'readonly' of property 'd1' restricts attribute 'readwrite' of 'I' property in super class}} expected-warning {{property 'd1' 'copy' attribute does not match super class 'I' property}}
+@property (readwrite, copy) I* d2; // expected-warning {{property type 'I *' does not match super class 'I' property type}}
+@end
+