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

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 8 10:30:09 PDT 2025


================
@@ -332,6 +332,53 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) {
   verifyNoCrash(StringRef("/*\\\0\n/", 6));
 }
 
+TEST_F(FormatTestComments, InsertsSpaceBeforeClosingBlockComment) {
+  FormatStyle Style = getLLVMStyle();
+  Style.SpaceBeforeClosingBlockComment = true;
+
+  verifyFormat("foo(/* comment */);", "foo(/* comment*/);", Style);
+  verifyFormat("foo(/*Logger= */nullptr);", "foo(/*Logger=*/nullptr);", Style);
----------------
mydeveloperday wrote:

I think I want to handle this different from comments

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


More information about the cfe-commits mailing list