summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-08-14 18:06:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-08-14 18:06:25 +0000
commit83b000c713374049034af3deb59bba01d0731b86 (patch)
treeed958937b81ebab9103e1b30f2a91fe9abc3a6db /clang/lib/Sema/SemaDeclObjC.cpp
parent6a95bcec19dddae062e8fad0dc8951e577501f44 (diff)
downloadbcm5719-llvm-83b000c713374049034af3deb59bba01d0731b86.tar.gz
bcm5719-llvm-83b000c713374049034af3deb59bba01d0731b86.zip
Fixed a regression in deciding when to issue warning on properties which
implement NSCopying protocol in GC mode. llvm-svn: 79008
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 75ac33673ca..7f7bcd2a94c 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -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);
OpenPOWER on IntegriCloud