[clang-tools-extra] Refactor clang doc comment structure (PR #142273)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 3 16:04:54 PDT 2025


================
@@ -670,12 +671,17 @@ static std::unique_ptr<HTMLNode> genHTML(const CommentInfo &I) {
       return nullptr;
     return std::move(BlockComment);
   }
-  if (I.Kind == "TextComment") {
-    if (I.Text == "")
+
+  case CommentKind::CK_TextComment: {
+    if (I.Text.empty())
       return nullptr;
     return std::make_unique<TextNode>(I.Text);
   }
-  return nullptr;
+
+  // For now, no handling — fallthrough.
+  default:
----------------
ilovepi wrote:

Let's handle all the cases w/o default. Then we should get an error if we change the enum and don't handle it here.

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


More information about the cfe-commits mailing list