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

    <tr>
        <th>Summary</th>
        <td>
            clang-format introduces unnecessary indentation for scope resolution operator
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

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

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

<pre>
    clang-format seems to sometimes get confused in the middle of a designated initialization epxression, causing it to introduce a new level of indentation for each scope resolution operator when trying to access names defined within a class. For example:

```c++
  CO_EXPECT_CALL(*wrapped_, ReconstructChunks)
 .WillOnce(
          c9::CoReturn(Reconstructor::
 ReconstructChunksResult{
                               .results =
 {
                                       {
 .result =
 Reconstructor::
 ReconstructChunksResult::
 ChunkDetails{
 .chunk_id =
 {
 .volume_id = colossus::TestVolumeIds::Get(colossus::
 D_VolumeUtil::Partition::kSsd),
 },
 .length =
 colossus::
 ChunkLength{
 200},
 },
                                       },
 {
                                           .result =
 Reconstructor::ReconstructChunksResult::ChunkDetails{
 .chunk_id =
 {
 .volume_id = colossus::
 TestVolumeIds::Get(colossus::D_VolumeUtil::Partition::kHdd),
 },
 .length =
 colossus::ChunkLength{
 200},
 },
                                       },
 {
                                           .result = absl::InternalError(
                                               "some error"),
                                       },
 {
                                           .result =
 Reconstructor::ReconstructChunksResult::ChunkDetails{
 .chunk_id =
 {
 .volume_id = colossus::
 TestVolumeIds::Get(colossus::D_VolumeUtil::Partition::kHdd),
 },
 .length =
 colossus::ChunkLength{
 200},
 },
                                       },
 },
                               .bytes_read_hdd = 100,
 .bytes_read_ssd = 300,
 }));
```

It looks like some of this is an effort to avoid hitting 80 columns, but it just makes things worse and the overall expression goes over 80 columns and is very difficult to read. It's also not always necessary to avoid 80 columns: for example `Reconstructor::ReconstructChunksResult{` would all fit within 80 I believe.
</pre>
<img width="1" height="1" alt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