<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57824>57824</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Wrong formatting with ExperimentalAutoDetectBinPacking
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jchia
      </td>
    </tr>
</table>

<pre>
    Version: `Ubuntu clang-format version 16.0.0-++20220914052859+c9ef7d49abff-1~exp1~20220914173001.379`

Options: `--style='{ColumnLimit: 100, ExperimentalAutoDetectBinPacking: yes}'`

Input:
```
Foo000000000000000::Foo000000000000000(string const& filename,
                                       shared_ptr<Bar000000000000000 const> bar000000000000000,
                                       Baz const& config) { }
```

Output:
```
Foo000000000000000::Foo000000000000000(string const &filename,
                                       shared_ptr<Bar000000000000000 const>
                                           bar000000000000000,
                                       Baz const &config) {}
```

Since `ColumnLimit` is 100, the line with `shared_ptr` should not have been broken. The problem does not repro if `bar000000000000000` is renamed to `bar` or the options are `--style='{ColumnLimit: 100, BinPackParameters: yes}'`. 

The following documentation text does not suggest that ExperimentalAutoDetectBinPacking is more buggy than other features. If 'experimental' means 'buggy' in addition to being prone to being renamed or removal, the documentation should say so.

> NOTE: This is an experimental flag, that might go away or be renamed. Do not use this in config files, etc. Use at your own risk.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VU1v4zYQ_TX0ZWCBoizLOugQxwmwQNFdoNn2WFDSSOKGIg2SSuL--g5luXG2QXcX6AqExI_hmzePM1Rt21P1OzqvrGHZDbAt_1xPJkzQaGn6dWfdKAM8nS0g3SY84Wsm9tQEF4KX6YbnYpeXNNGU2BXtppR1161TVtzhyzF-LoZpkXGeJllRkhvGD4zfnN8fj4HQ_UJgvfbhpJFlByYKVuxvrZ5G84saVYgWKedM3MLdyxGdGtEEqW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