logic: fixed getting the parent of a Cxx template parameter's declaration

* switched to getting the template parameter's parent from the ASTContext instead of using the DeclContext
This commit is contained in:
mlangkabel
2017-11-14 12:09:32 +01:00
parent 6488c6538e
commit 9d17e2e7e6
7 changed files with 203 additions and 50 deletions
@@ -475,14 +475,12 @@ void CxxAstVisitor::traverseDeclContextHelper(clang::DeclContext* d)
return;
}
// Traverse children.
for (clang::DeclContext::decl_iterator it = d->decls_begin(),
itEnd = d->decls_end(); it != itEnd; ++it)
{
// BlockDecls are traversed through BlockExprs.
if (!llvm::isa<clang::BlockDecl>(*it))
for (auto* child : d->decls()) {
// BlockDecls and CapturedDecls are traversed through BlockExprs and
// CapturedStmts respectively.
if (!llvm::isa<clang::BlockDecl>(child) && !llvm::isa<clang::CapturedDecl>(child))
{
TraverseDecl(*it);
TraverseDecl(child);
}
}
}