[clang] [clang-format] Allow line breaking with PointerAlignment configured (PR #164686)

via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 25 19:25:30 PDT 2025


================
@@ -8644,6 +8644,28 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
                "                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}",
                Style);
 
+  Style.ColumnLimit = 70;
+  verifyFormat(
+      "void foo(const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName*\n"
+      "             my_super_super_super_super_long_variable_name) {}",
+      Style);
+  verifyFormat(
+      "void foo(const MySuperSuperSuperSuperSuperSuperSuperSuperLongTypeName*\n"
+      "             const my_super_super_super_super_long_variable_name) {}",
----------------
owenca wrote:

`*` and `const` should stay together on the same line.

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


More information about the cfe-commits mailing list