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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] patch number changes format output
        </td>
    </tr>

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

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

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

<pre>
    I ran into an issue with CI patch number differing from our CI patch number of `clang-format`. CI and my local `clang-format` produced different results. I can reproduce this with the following:

```c++
// test_file.cxx
#include <iomanip>
#include <iostream>

int main(int argc, char const *argv[]) {
  std::cout 
        << std::fixed 
        << std::setprecision(1) 
        << "  - " 
        << std::setw(02) 
        << 10 
        << " | " 
        << std::setw(12) 
        << "hello"
        << " | "
        << "test: (" 
        << std::setw(04) 
        << 1 
        << ", " 
        << std::setw(04) 
        << 2 
        << ", " 
 << std::setw(04) 
        << 3 
        << ", "
        << std::setw(04) 
        << 5 
        << ") | " 
        << std::endl;
  return 0;
}
```

Running the commands:

```bash
$ cat .clang-format
---
BasedOnStyle: Google
ColumnLimit: 120
SpaceBeforeCpp11BracedList: true
Cpp11BracedListStyle: true
AlignAfterOpenBracket: BlockIndent
BinPackArguments: false
BinPackParameters: false
InsertTrailingCommas: Wrapped
BreakConstructorInitializers: BeforeColon
PackConstructorInitializers: CurrentLine
SpacesInParentheses: false
AlignOperands: Align
BreakBeforeBinaryOperators: false
PenaltyIndentedWhitespace: 1
IndentPPDirectives: BeforeHash

$ clang-format-18 --version
Ubuntu clang-format version 18.1.6 (++20240518023229+1118c2e05e67-1~exp1~20240518143321.130)


$ clang-format-18 --style=file test_file.cxx
#include <iomanip>
#include <iostream>

int main(int argc, char const *argv[]) {
  std::cout << std::fixed << std::setprecision(1) << "  - " << std::setw(02) << 10 << " | " << std::setw(12) << "hello"
            << " | "
            << "test: (" << std::setw(04) << 1 << ", " << std::setw(04) << 2 << ", " << std::setw(04) << 3 << ", "
            << std::setw(04) << 5 << ") | " << std::endl;
  return 0;
}
```

Then with a different version of `clang-format`
```bash
$ clang-format-18 --version
Ubuntu clang-format version 18.1.3 (1)

$ clang-format-18 --style=file test_file.cxx 
#include <iomanip>
#include <iostream>

int main(int argc, char const *argv[]) {
  std::cout << std::fixed << std::setprecision(1) << "  - " << std::setw(02) << 10 << " | " << std::setw(12) << "hello"
            << " | " << "test: (" << std::setw(04) << 1 << ", " << std::setw(04) << 2 << ", " << std::setw(04) << 3
            << ", " << std::setw(04) << 5 << ") | " << std::endl;
  return 0;
}

```

I suspect that a bug was introduced somewhere between `18.1.3` and `18.1.6`. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV0uP2zYQ_jX0ZWBDpPw8-GB7u62BAFk0KXIsKGoksUuRAh_76CG_vaAkr9dZv9IsCgSoYVgG5-M8yJn5NNw5WWrEJZmsyeRmwIOvjF3W3Huuy-AGmcmfl1uwXIPU3kB8OhcQHqWvYLOFhntRgQ51hhZyWRRopS6hsKYGE-wbiCmATBOhuC6HhbE192SajCKM6xzqZ1BGcHUEA401eRCY91ZQe7DogvJuBFsQXIPFHgO-kq5z0VcIhVHKPEpdknRFkhuS7H6nSfcVhK3jt1tlt4Tdgkfn_yykwpF4etpJUqmFCjkCSTfS1FzLhqS_HJc6b5HXe3H7K7WHmktN2Dz-5bYUhG1AVNyCMNp5IGzFbfnQXQhhCyCz3jEA5_MYQroSJnjYrXYfkm5IutlDCvmE-QWMQ99YFNJJEz2irbljOwhjAMP2cVHjI2HzhJ1URZPTJshsc70NetoGYaxCpQxh7JKtU_J4_SRdAWHz66Men476pKPx-t_DwgkNby18v-r0kuof9X1yxsDiyqxAnSuSvpSKRR-shuRlicxuvqn613X5e9A69q3YLoSpa65zd6pbZNxVu5Ifg-AeRge9qhUNh8Puz5o7zD_qT_5ZYUyoX40pFXayjVGh1h9kLdtco6z36VPDBa6xMBY3TUPp2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