llvm / llvm/llvm-project

[clangd] Implicit destructors not recorded as reference

Open
#169,824 4 comments 0 reactions 0 assignees View on GitHub
clangd
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Currently clangd’s call hierarchy and reference don’t include destructors, making the analysis incomplete, for example: https://github.com/llvm/llvm-project/issues/157876

While there is no actual position for destructor, I think it is reasonable to be at the same location of the corresponding constructor because it is decided there. I am new to clang AST but I think the information can be infered from it. Just found https://github.com/llvm/llvm-project/pull/166110. Currently I am looking into `clang-tools-extra/clangd/index/SymbolCollector.cpp`, not sure whether in the right direction.

But I am also unsure whether adding destructor will break existing rules. Need help.

Contributor guide

Open the contributing guide

Research direction

Start by reading clang-tools-extra/clangd/index/SymbolCollector.cpp and the related discussion in issue 157876, then compare the behavior described with pull request 166110. Determine how implicit destructors could be represented at the corresponding constructor location without breaking existing reference and call-hierarchy rules; done means destructor references appear in both analyses consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.