summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index b42950ffc0b..198bc4a19ec 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -339,6 +339,8 @@ void Decl::Destroy(ASTContext& C) {
DeclContext *DeclContext::getParent() const {
if (ScopedDecl *SD = dyn_cast<ScopedDecl>(this))
return SD->getDeclContext();
+ else if (BlockDecl *BD = dyn_cast<BlockDecl>(this))
+ return BD->getParentContext();
else
return NULL;
}
OpenPOWER on IntegriCloud