[clang] clang-format: Add splitting for strings with user-defined suffixes (PR #167150)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 9 15:02:26 PST 2025


================
@@ -15838,6 +15838,10 @@ TEST_F(FormatTest, BreaksWideAndNSStringLiterals) {
                "@\"NSString literal\";", getGoogleStyleWithColumns(19));
   verifyFormat(R"(NSString *s = @"那那那那";)", getLLVMStyleWithColumns(26));
 
+  EXPECT_EQ("L\"suffixed \"\n"
+            "L\"string\"_s;",
+            format("L\"suffixed string\"_s;", getLLVMStyleWithColumns(19)));
----------------
HazardyKnusperkeks wrote:

```suggestion
  verifyFormat("L\"suffixed \"\n"
            "L\"string\"_s;",
            "L\"suffixed string\"_s;", getLLVMStyleWithColumns(19)));
```

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


More information about the cfe-commits mailing list