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

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 20 10:03:29 PST 2026


================
@@ -156,19 +156,17 @@ static void writeNameLink(const StringRef &CurrentPath, const Reference &R,
 
 static void genMarkdown(const ClangDocContext &CDCtx, const EnumInfo &I,
                         llvm::raw_ostream &OS) {
-  std::string Header = "| enum ";
+  OS << "| enum ";
   if (I.Scoped)
-    Header += "class ";
-  Header += I.Name;
-  Header += " ";
-  if (I.BaseType && I.BaseType->Type.QualName != "") {
-    Header += ": ";
-    Header += I.BaseType->Type.QualName;
-    Header += " ";
+    OS << "class ";
+  if(I.Name.empty())
+    OS << "(unnamed) ";
+  else
+    OS << I.Name << " ";
----------------
ilovepi wrote:

```suggestion
  OS <<  (I.Name.empty() ? "(unnamed)" : I.Name) << " ";
```
Assuming this is needed.

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


More information about the cfe-commits mailing list