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 | e9686572f17968048a5e097254f85c202ea44aec (patch) | |
tree | 0225f36ed832a5a80d766eb51d1bd2a9e8e4ade2 /lib/Sema/SemaObjCProperty.cpp | |
parent | 01ae93fde8497978c860c8b61d098cf22c0e5d3d (diff) |
Use cast<> + OpaquePtr.getAs<Decl> to add extra checking of our assumptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 605750408c..cda1f0be20 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/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); |