Author: fjahanian
Date: Mon Nov 28 12:38:27 2011
New Revision: 145255

URL: http://llvm.org/viewvc/llvm-project?rev=145255&view=rev
Log:
objc: turn warning for property type mismatch in 
primary and its continuation class into error.
// rdar://10142679

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

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=145255&r1=145254&r2=145255&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Mon Nov 28 12:38:27 2011
@@ -123,7 +123,6 @@
 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
 def ObjCReadonlyPropertyHasSetter : 
DiagGroup<"objc-readonly-with-setter-property">;
-def ObjCContinuationPropertyType :DiagGroup<"objc-continuation-property-type">;
 def Packed : DiagGroup<"packed">;
 def Padded : DiagGroup<"padded">;
 def PointerArith : DiagGroup<"pointer-arith">;

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=145255&r1=145254&r2=145255&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Nov 28 12:38:27 
2011
@@ -539,9 +539,9 @@
 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 warn_type_mismatch_continuation_class : Warning<
+def err_type_mismatch_continuation_class : Error<
   "type of property %0 in continuation class does not match "
-  "property type in primary class">, InGroup<ObjCContinuationPropertyType>;
+  "property type in primary class">;
 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 "

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=145255&r1=145254&r2=145255&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Mon Nov 28 12:38:27 2011
@@ -279,7 +279,7 @@
   if (PIDecl->getType().getCanonicalType() 
       != PDecl->getType().getCanonicalType()) {
     Diag(AtLoc, 
-         diag::warn_type_mismatch_continuation_class) << PDecl->getType();
+         diag::err_type_mismatch_continuation_class) << PDecl->getType();
     Diag(PIDecl->getLocation(), diag::note_property_declare);
   }
     

Modified: cfe/trunk/test/SemaObjC/continuation-class-property.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/continuation-class-property.m?rev=145255&r1=145254&r2=145255&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/continuation-class-property.m (original)
+++ cfe/trunk/test/SemaObjC/continuation-class-property.m Mon Nov 28 12:38:27 
2011
@@ -38,6 +38,6 @@
 @end
 
 @interface MyClass ()
-@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}}
+@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}}
 @end


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to