[clang-tools-extra] [clang-doc] Add a breadcrumb navigation bar (PR #173297)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 6 10:04:40 PST 2026
================
@@ -697,10 +697,46 @@ static TemplateParamInfo convertTemplateArgToInfo(const clang::Decl *D,
return TemplateParamInfo(Str);
}
+// Check if the DeclKind is one for which we support contextual relationships.
+// There might be other ContextDecls, like blocks, that we currently don't
+// handle at all.
+static bool isSupportedContext(Decl::Kind DeclKind) {
+ switch (DeclKind) {
+ case Decl::Kind::Record:
+ case Decl::Kind::CXXRecord:
+ case Decl::Kind::ClassTemplateSpecialization:
+ case Decl::Kind::ClassTemplatePartialSpecialization:
+ case Decl::Kind::Namespace:
+ return true;
+ default:
+ return false;
+ }
+}
+
+template <typename T> static void findParent(Info &I, const T *D) {
----------------
ilovepi wrote:
Actually, does this need to be a template? Aren't all the things passed in here `clangDecl`? IIRC all types that can be cast to `DeclContext` should also be `Decl`. Besides, `getKind()` is a `Decl` method.
https://github.com/llvm/llvm-project/pull/173297
More information about the cfe-commits
mailing list