[clang] [clang-format] Option to insert spaces before the closing `*/` (PR #162105)

via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 1 19:13:10 PDT 2025


================
@@ -315,6 +315,19 @@ class AnnotatedLine;
 
 /// A wrapper around a \c Token storing information about the
 /// whitespace characters preceding it.
+
+// Describes the kind of a block comment.
+enum class CommentKind {
+  // A plain comment, i.e. /* ... */.
+  Plain,
+  // A comment that starts with /*! or /**.
+  Docstring,
+  // A comment that looks like a parameter, e.g. /*in*/.
+  Parameter,
+  // A comment that is a sentinel, e.g. /*FALLTHROUGH*/.
+  Sentinel,
----------------
Men-cotton wrote:

Thanks for the clarification. I’m not aware of any style guide that treats sentinel comments differently either, so I’ve dropped the Sentinel classification/detection and they now fall back to the plain comment handling. I kept the separate treatment for parameter-hint comments as discussed.

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


More information about the cfe-commits mailing list