mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-01 12:26:09 +00:00
ObjectiveC. Fixes a bogus warning of unused backing
ivar when property belongs to a super class and currnt class happens to have a method with same name as property. // rdar//15473432 llvm-svn: 194830
This commit is contained in:
parent
a6dedc6ccc
commit
617e49ad59
@ -3510,8 +3510,17 @@ Sema::GetIvarBackingPropertyAccessor(const ObjCMethodDecl *Method,
|
||||
Method = IDecl->lookupMethod(Method->getSelector(), true);
|
||||
if (!Method || !Method->isPropertyAccessor())
|
||||
return 0;
|
||||
if ((PDecl = Method->findPropertyDecl()))
|
||||
if ((PDecl = Method->findPropertyDecl())) {
|
||||
if (!PDecl->getDeclContext())
|
||||
return 0;
|
||||
// Make sure property belongs to accessor's class and not to
|
||||
// one of its super classes.
|
||||
if (const ObjCInterfaceDecl *CID =
|
||||
dyn_cast<ObjCInterfaceDecl>(PDecl->getDeclContext()))
|
||||
if (CID != IDecl)
|
||||
return 0;
|
||||
return PDecl->getPropertyIvarDecl();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -49,3 +49,28 @@
|
||||
okIvar = newT;
|
||||
}
|
||||
@end
|
||||
|
||||
// rdar://15473432
|
||||
typedef char BOOL;
|
||||
@interface CalDAVServerVersion {
|
||||
BOOL _supportsTimeRangeFilterWithoutEndDate;
|
||||
}
|
||||
@property (nonatomic, readonly,nonatomic) BOOL supportsTimeRangeFilterWithoutEndDate;
|
||||
@end
|
||||
|
||||
@interface CalDAVConcreteServerVersion : CalDAVServerVersion {
|
||||
}
|
||||
@end
|
||||
|
||||
@interface CalendarServerVersion : CalDAVConcreteServerVersion
|
||||
@end
|
||||
|
||||
@implementation CalDAVServerVersion
|
||||
@synthesize supportsTimeRangeFilterWithoutEndDate=_supportsTimeRangeFilterWithoutEndDate;
|
||||
@end
|
||||
|
||||
@implementation CalendarServerVersion
|
||||
-(BOOL)supportsTimeRangeFilterWithoutEndDate {
|
||||
return 0;
|
||||
}
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user