[clang] [clang-format] Prevent line comment continuation across formatting-disabled boundary (PR #233414)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 12:09:02 PDT 2026


================
@@ -22638,6 +22638,37 @@ TEST_F(FormatTest, OneLineFormatOffRegex) {
                "  tm t; // FormatOff\n"
                " int i;",
                Style);
+
+  Style = getLLVMStyle();
+  Style.UseTab = FormatStyle::UT_Always;
+  Style.TabWidth = 4;
+  Style.IndentWidth = 4;
+  Style.ReflowComments = FormatStyle::RCS_Never;
+  Style.OneLineFormatOffRegex = "// #if";
+  verifyFormat("void f() {\n"
----------------
HazardyKnusperkeks wrote:

Why use the 3 argument variant, instead of the 2 argument variant? Especially since the issue is a non stable formatting.

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


More information about the cfe-commits mailing list