objc: Turn diagnostic on property type mismatch in

continuation class into warning. // rdar://10231514

llvm-svn: 141100
This commit is contained in:
Fariborz Jahanian 2011-10-04 18:44:26 +00:00
parent 83e84faa8f
commit f2a7b0eade
4 changed files with 6 additions and 5 deletions

View File

@ -99,6 +99,7 @@ def OverlengthStrings : DiagGroup<"overlength-strings">;
def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
def ObjCContinuationPropertyType :DiagGroup<"objc-continuation-property-type">;
def Packed : DiagGroup<"packed">;
def Padded : DiagGroup<"padded">;
def PointerArith : DiagGroup<"pointer-arith">;

View File

@ -518,9 +518,9 @@ def warn_default_atomic_custom_getter_setter : Warning<
def err_use_continuation_class : Error<
"illegal redeclaration of property in continuation class %0"
" (attribute must be 'readwrite', while its primary must be 'readonly')">;
def error_type_mismatch_continuation_class : Error<
def warn_type_mismatch_continuation_class : Warning<
"type of property %0 in continuation class does not match "
"property type in primary class">;
"property type in primary class">, InGroup<ObjCContinuationPropertyType>;
def err_use_continuation_class_redeclaration_readwrite : Error<
"illegal redeclaration of 'readwrite' property in continuation class %0"
" (perhaps you intended this to be a 'readwrite' redeclaration of a "

View File

@ -238,7 +238,7 @@ Sema::HandlePropertyInClassExtension(Scope *S,
if (PIDecl->getType().getCanonicalType()
!= PDecl->getType().getCanonicalType()) {
Diag(AtLoc,
diag::error_type_mismatch_continuation_class) << PDecl->getType();
diag::warn_type_mismatch_continuation_class) << PDecl->getType();
Diag(PIDecl->getLocation(), diag::note_property_declare);
}

View File

@ -38,6 +38,6 @@ typedef struct {
@end
@interface MyClass ()
@property (readwrite) NSString *foo; // expected-error {{type of property 'NSString *' in continuation class does not match property type in primary class}}
@property (readwrite, strong) NSRect bar; // expected-error {{type of property 'NSRect' in continuation class does not match property type in primary class}}
@property (readwrite) NSString *foo; // expected-warning {{type of property 'NSString *' in continuation class does not match property type in primary class}}
@property (readwrite, strong) NSRect bar; // expected-warning {{type of property 'NSRect' in continuation class does not match property type in primary class}}
@end