forked from OSchip/llvm-project
Objective-C. Do not warn if user is using property-dox syntax to name a
user provided setter name (as declared in @property attribute declaration). rdar://18022762 llvm-svn: 215736
This commit is contained in:
parent
5b1dbec1b4
commit
4eda2c0086
|
@ -1708,12 +1708,16 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
|
||||||
// name 'x'.
|
// name 'x'.
|
||||||
if (Setter && Setter->isImplicit() && Setter->isPropertyAccessor()
|
if (Setter && Setter->isImplicit() && Setter->isPropertyAccessor()
|
||||||
&& !IFace->FindPropertyDeclaration(Member)) {
|
&& !IFace->FindPropertyDeclaration(Member)) {
|
||||||
if (const ObjCPropertyDecl *PDecl = Setter->findPropertyDecl())
|
if (const ObjCPropertyDecl *PDecl = Setter->findPropertyDecl()) {
|
||||||
|
// Do not warn if user is using property-dot syntax to make call to
|
||||||
|
// user named setter.
|
||||||
|
if (!(PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_setter))
|
||||||
Diag(MemberLoc,
|
Diag(MemberLoc,
|
||||||
diag::warn_property_access_suggest)
|
diag::warn_property_access_suggest)
|
||||||
<< MemberName << QualType(OPT, 0) << PDecl->getName()
|
<< MemberName << QualType(OPT, 0) << PDecl->getName()
|
||||||
<< FixItHint::CreateReplacement(MemberLoc, PDecl->getName());
|
<< FixItHint::CreateReplacement(MemberLoc, PDecl->getName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Getter || Setter) {
|
if (Getter || Setter) {
|
||||||
if (Super)
|
if (Super)
|
||||||
|
|
|
@ -151,7 +151,7 @@ int main (void) {
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
self.formatter = 0; // expected-warning {{property 'formatter' not found on object of type 'FMXBridgeFormatter *'; did you mean to access property cppFormatter?}}
|
self.formatter = 0;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue