[clang] [clang-tools-extra] Handle recording inheritance for templates (PR #177273)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 10 12:04:53 PDT 2026
timon-ul wrote:
Okay I made some good progress, that being said, I have a few new questions:
I created a new function in `AST.h`, `isTemplateInstantiation()` to check if something is either an implicit or an explicit instantiation. This is to add to the `isIndexedForCodeCompletion` check that so far only cares about explicit specializations but to me it makes sense that implicit instantiations also do not get this (for the same reason explicit specializations do not). The issue I realized after is that this function already exists, in `Specifiers.h`, just with a logic on a `TemplateSpecializationKind`, not sure if this naming overlap is a problem and if I should change it. But also I realized later on that technically this check does not even matter since I return before this check is used anyway, so now it only exists for correct information in `Symbol.Flags`. So I am a bit unsure if I should remove it, since it technically the right thing.
Right now in `addDeclaration()` I return early when we are an implicit instantiation, I think this is completly fine for now, but I have been thinking if it wouldn't be "nicer" to instead make it a flag on `Symbol` like everything else. Maybe in the future if there are any other cases where we do not want to generate docs.
I have thought for a long time and I am honestly not quite sure what the problem in your comment [here](https://github.com/llvm/llvm-project/pull/177273#discussion_r2753063230) is and I think I need some elaboration. This is also why there is still no TODO since I am unsure what to write. Like should a `findReference` search on `T` of `T field` return `A`, `B` and `C`?
https://github.com/llvm/llvm-project/pull/177273
More information about the cfe-commits
mailing list