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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user