[cfe-commits] r157517 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaPseudoObject.cpp test/SemaObjC/property-user-setter.m
Fariborz Jahanian
fjahanian at apple.com
Sat May 26 09:10:06 PDT 2012
Author: fjahanian
Date: Sat May 26 11:10:06 2012
New Revision: 157517
URL: http://llvm.org/viewvc/llvm-project?rev=157517&view=rev
Log:
Change warning to error when property setter names conflict.
// rdar://11528439
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaPseudoObject.cpp
cfe/trunk/test/SemaObjC/property-user-setter.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=157517&r1=157516&r2=157517&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat May 26 11:10:06 2012
@@ -626,10 +626,9 @@
def warn_property_getter_owning_mismatch : Warning<
"property declared as returning non-retained objects"
"; getter returning retained objects">;
-def warn_property_setter_ambiguous_use : Warning<
+def error_property_setter_ambiguous_use : Error<
"synthesized properties '%0' and '%1' both claim setter %2 -"
- " use of this setter may cause unexpected behavior">,
- InGroup<DiagGroup<"objc-multiple-property-setter-use">>;
+ " use of this setter will cause unexpected behavior">;
def err_ownin_getter_rule : Error<
"property's synthesized getter follows Cocoa naming"
" convention for returning 'owned' objects">;
Modified: cfe/trunk/lib/Sema/SemaPseudoObject.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaPseudoObject.cpp?rev=157517&r1=157516&r2=157517&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaPseudoObject.cpp (original)
+++ cfe/trunk/lib/Sema/SemaPseudoObject.cpp Sat May 26 11:10:06 2012
@@ -543,7 +543,7 @@
IdentifierInfo *AltMember = &S.PP.getIdentifierTable().get(PropertyName);
if (ObjCPropertyDecl *prop1 = IFace->FindPropertyDeclaration(AltMember))
if (prop != prop1 && (prop1->getSetterMethodDecl() == setter)) {
- S.Diag(RefExpr->getExprLoc(), diag::warn_property_setter_ambiguous_use)
+ S.Diag(RefExpr->getExprLoc(), diag::error_property_setter_ambiguous_use)
<< prop->getName() << prop1->getName() << setter->getSelector();
S.Diag(prop->getLocation(), diag::note_property_declare);
S.Diag(prop1->getLocation(), diag::note_property_declare);
Modified: cfe/trunk/test/SemaObjC/property-user-setter.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-user-setter.m?rev=157517&r1=157516&r2=157517&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-user-setter.m (original)
+++ cfe/trunk/test/SemaObjC/property-user-setter.m Sat May 26 11:10:06 2012
@@ -127,10 +127,10 @@
self.P = 0; // expected-error {{property 'P' not found on object of type 'rdar11363363 *'}}
self.q = 0; // expected-error {{property 'q' not found on object of type 'rdar11363363 *'}}
// rdar://11528439
- self.t = 0; // expected-warning {{synthesized properties 't' and 'T' both claim setter 'setT:'}}
- self.T = 0; // expected-warning {{synthesized properties 'T' and 't' both claim setter 'setT:'}}
- self.Pxyz = 0; // expected-warning {{synthesized properties 'Pxyz' and 'pxyz' both claim setter 'setPxyz:'}}
- self.pxyz = 0; // expected-warning {{synthesized properties 'pxyz' and 'Pxyz' both claim setter 'setPxyz:'}}
+ self.t = 0; // expected-error {{synthesized properties 't' and 'T' both claim setter 'setT:'}}
+ self.T = 0; // expected-error {{synthesized properties 'T' and 't' both claim setter 'setT:'}}
+ self.Pxyz = 0; // expected-error {{synthesized properties 'Pxyz' and 'pxyz' both claim setter 'setPxyz:'}}
+ self.pxyz = 0; // expected-error {{synthesized properties 'pxyz' and 'Pxyz' both claim setter 'setPxyz:'}}
self.R = 0; // expected-error {{property 'R' not found on object of type 'rdar11363363 *'; did you mean to access ivar 'R'?}}
return self.R; // expected-error {{property 'R' not found on object of type 'rdar11363363 *'; did you mean to access ivar 'R'?}}
}
More information about the cfe-commits
mailing list