[clang] [clang-tools-extra] [Index] Reflect in SymbolSubKind whether a typedef points to a struct or a class (PR #181967)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 13:45:59 PST 2026


================
@@ -310,13 +332,15 @@ SymbolInfo index::getSymbolInfo(const Decl *D) {
       Info.Lang = SymbolLanguage::CXX;
       Info.Properties |= (SymbolPropertySet)SymbolProperty::Generic;
       break;
-    case Decl::TypeAlias:
+    case Decl::TypeAlias: {
       Info.Kind = SymbolKind::TypeAlias;
+      Info.SubKind = getSubKindForTypedef(cast<TypeAliasDecl>(D));
       Info.Lang = SymbolLanguage::CXX;
       break;
+    }
     case Decl::UnresolvedUsingTypename:
       Info.Kind = SymbolKind::Using;
-      Info.SubKind = SymbolSubKind::UsingTypename;
----------------
hokein wrote:

For dependent code, we can't guarantee the underlying type is a class/struct. It might be better to retain `UsingTypename` for those cases rather than forcing a `UsingClass` subkind.

https://github.com/llvm/llvm-project/pull/181967


More information about the cfe-commits mailing list