diff --git a/src/semantic/filtered_ast_visitor.h b/src/semantic/filtered_ast_visitor.h index 2f09035a..20e84160 100644 --- a/src/semantic/filtered_ast_visitor.h +++ b/src/semantic/filtered_ast_visitor.h @@ -33,6 +33,8 @@ class FilteredASTVisitor : public clang::RecursiveASTVisitor { return true; } + /// Clang doesn't visit implicit declarations and + /// implicit template instantiations by default. if(llvm::isa(decl)) { if(interested_only) { for(auto top: unit.top_level_decls()) { @@ -46,29 +48,6 @@ class FilteredASTVisitor : public clang::RecursiveASTVisitor { return Base::TraverseDecl(decl); } - if(decl->isImplicit()) { - return true; - } - - /// We don't want to visit implicit instantiation. - if(auto SD = llvm::dyn_cast(decl)) { - if(SD->getSpecializationKind() == clang::TSK_ImplicitInstantiation) { - return true; - } - } - - if(auto SD = llvm::dyn_cast(decl)) { - if(SD->getTemplateSpecializationKind() == clang::TSK_ImplicitInstantiation) { - return true; - } - } - - if(auto SD = llvm::dyn_cast(decl)) { - if(SD->getSpecializationKind() == clang::TSK_ImplicitInstantiation) { - return true; - } - } - if constexpr(requires { getDerived().on_traverse_decl(decl, &Base::TraverseDecl); }) { return getDerived().on_traverse_decl(decl, &Base::TraverseDecl); } else {