[clang-tools-extra] Extend call hierarchy for field and non-local variables (PR #113900)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 31 23:07:26 PDT 2024
================
@@ -2238,7 +2238,10 @@ prepareCallHierarchy(ParsedAST &AST, Position Pos, PathRef TUPath) {
for (const NamedDecl *Decl : getDeclAtPosition(AST, *Loc, {})) {
if (!(isa<DeclContext>(Decl) &&
cast<DeclContext>(Decl)->isFunctionOrMethod()) &&
- Decl->getKind() != Decl::Kind::FunctionTemplate)
+ !(Decl->getKind() == Decl::Kind::Var &&
+ !cast<VarDecl>(Decl)->isLocalVarDecl()) &&
+ Decl->getKind() != Decl::Kind::FunctionTemplate &&
----------------
HighCommander4 wrote:
nit: can can you keep the function template check next to the function check, since they are related?
https://github.com/llvm/llvm-project/pull/113900
More information about the cfe-commits
mailing list