diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-04-05 23:45:09 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-04-05 23:45:09 +0000 |
| commit | 273c4f53ec5055b1cdaddc2f685910c6fdd4ef74 (patch) | |
| tree | bbb6872d913bfbad8e7b6ad6efe3a4b872ab93ec /clang/lib/Sema/SemaObjCProperty.cpp | |
| parent | 272a2f8432a02ae947c2ddaa8db1ca25f0d0befe (diff) | |
| download | bcm5719-llvm-273c4f53ec5055b1cdaddc2f685910c6fdd4ef74.tar.gz bcm5719-llvm-273c4f53ec5055b1cdaddc2f685910c6fdd4ef74.zip | |
Use cast<> + OpaquePtr.getAs<Decl> to add extra checking of our assumptions.
llvm-svn: 100496
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 605750408ce..cda1f0be202 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -160,7 +160,7 @@ Sema::HandlePropertyInClassExtension(Scope *S, ObjCCategoryDecl *CDecl, PIDecl->getSetterName(), DeclPtrTy::make(CCPrimary), isOverridingProperty, MethodImplKind); - PIDecl = ProtocolPtrTy.getAs<ObjCPropertyDecl>(); + PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy.getAs<Decl>()); } PIDecl->makeitReadWriteAttribute(); if (Attributes & ObjCDeclSpec::DQ_PR_retain) @@ -281,7 +281,8 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, DeclPtrTy ClassCatImpDecl, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar) { - ObjCContainerDecl *ClassImpDecl = ClassCatImpDecl.getAs<ObjCContainerDecl>(); + ObjCContainerDecl *ClassImpDecl = + cast_or_null<ObjCContainerDecl>(ClassCatImpDecl.getAs<Decl>()); // Make sure we have a context for the property implementation declaration. if (!ClassImpDecl) { Diag(AtLoc, diag::error_missing_property_context); |

