forked from OSchip/llvm-project
Fixed a regression in deciding when to issue warning on properties which
implement NSCopying protocol in GC mode. llvm-svn: 79008
This commit is contained in:
parent
6a95bcec19
commit
83b000c713
|
@ -1931,14 +1931,16 @@ Sema::DeclPtrTy Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
|
|||
isAssign && !(Attributes & ObjCDeclSpec::DQ_PR_assign))
|
||||
if (T->isObjCObjectPointerType()) {
|
||||
QualType InterfaceTy = T->getPointeeType();
|
||||
ObjCInterfaceDecl *IDecl=
|
||||
InterfaceTy->getAsObjCInterfaceType()->getDecl();
|
||||
if (const ObjCInterfaceType *OIT =
|
||||
InterfaceTy->getAsObjCInterfaceType()) {
|
||||
ObjCInterfaceDecl *IDecl = OIT->getDecl();
|
||||
if (IDecl)
|
||||
if (ObjCProtocolDecl* PNSCopying =
|
||||
LookupProtocol(&Context.Idents.get("NSCopying")))
|
||||
if (IDecl->ClassImplementsProtocol(PNSCopying, true))
|
||||
Diag(AtLoc, diag::warn_implements_nscopying)
|
||||
<< FD.D.getIdentifier();
|
||||
}
|
||||
}
|
||||
if (T->isObjCInterfaceType())
|
||||
Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object);
|
||||
|
|
|
@ -10,5 +10,6 @@
|
|||
|
||||
@interface INTF
|
||||
@property NSDictionary* undoAction; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}} // expected-warning {{default assign attribute on property 'undoAction' which implements NSCopying protocol is not appropriate with}}
|
||||
@property id okAction; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue