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

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 6 13:34:34 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:

There's still a default case here. I'm after a compiler error for unhandled enum values, so we can't use default. If the other cases should return nullptr, that's fine, they can all be here instead.

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


More information about the cfe-commits mailing list