[clang-tools-extra] [clang-doc] Display enum type along with enum name in HTML view (PR #181347)

Samrudh Nelli via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 13 21:56:18 PST 2026


================
@@ -565,9 +565,13 @@ static void serializeInfo(const EnumInfo &I, json::Object &Obj,
   if (I.BaseType) {
     json::Value BaseTypeVal = Object();
     auto &BaseTypeObj = *BaseTypeVal.getAsObject();
-    BaseTypeObj["Name"] = I.BaseType->Type.Name;
-    BaseTypeObj["QualName"] = I.BaseType->Type.QualName;
-    BaseTypeObj["USR"] = toHex(toStringRef(I.BaseType->Type.USR));
+    // Create a nested 'Type' object so the template can find {{Type.Name}}
+    json::Value TypeVal = Object();
+    auto &TypeObj = *TypeVal.getAsObject();
+    TypeObj["Name"] = I.BaseType->Type.Name;
+    TypeObj["QualName"] = I.BaseType->Type.QualName;
+    TypeObj["USR"] = toHex(toStringRef(I.BaseType->Type.USR));
+    BaseTypeObj["Type"] = TypeVal;
----------------
SamrudhNelli wrote:

Removed `Type` and all its corresponding keys. Added a `Name` key to `BaseType` to store the variable type.

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


More information about the cfe-commits mailing list