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

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 23:44:20 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"
----------------
akasakariko wrote:

Thanks for pointing this out

The two-argument form expresses the stability regression more directly

I will simplify the test to use the expected formatted code and Style

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


More information about the cfe-commits mailing list