]> granicus.if.org Git - clang/commitdiff
objc: Turn diagnostic on property type mismatch in
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 4 Oct 2011 18:44:26 +0000 (18:44 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 4 Oct 2011 18:44:26 +0000 (18:44 +0000)
continuation class into warning. // rdar://10231514

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141100 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/continuation-class-property.m

index 242c242d7d4e3b78557096559d521ff6e112b713..e704b61bfd25ea79bfe46ede72686e9aa28d5392 100644 (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">;
index 19fe1c5ad06af691008cadccf8f232cc77218301..5f36f18656cdb6a90dcedac70102f42a60fc2016 100644 (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 "
index 80c440907489a79eba8ea23160c82b73966c5575..880e9bfb2b27b2749ff70af7ce7a8158d1720bf1 100644 (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);
   }
     
index d017ac23dced2f29f8ada347ac056fe26ef67c68..a579184060b79496c44dfabd9a3ee3463a6d381d 100644 (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