<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJytld1vmzAQwP8aeLGKwIRAHnhIm-2pkyZte65sfIA3ByPbpB9__Q6TD5K06qpOQvb57nx3_vkArsVz-eWJbXsFpNICCIdaGyA4bJlzsmuCdB3EmyBeB8t4eqq-nzQ7LQWpA1oEdEWC_HbSklEkONKv-JA7vd1C5w62ybq3rTvtWjCY-cKHENk5woL0dq4TeuBYJz9TB_nmlHcmzlzGWNXZpn0kMVMeN5-Ew4H3Sz_ejZBY7bBqM3QdAiIjEsW65maCRhxYF42Qjjs_RO4NbqPXO9QumV3xeuWMp9yXlK4Y_SOhMxY7MFbqDpvoCtPeRJI0iqPLID-RIamlAkucJgZ6o8VQwakZs9sR8413iRwzUfMSZBsk2jrX29HPw2qkawceISpcKLU7TDcY8DdUDpc-BM55kS2yRYzSdWS6ei3ti-z_S87kPOcY9pjQj_dyBwT2r6muiWulJXxo5jiwtzywdytaf_tBx4zfW4kjV5rjJGAHSvf7QuxkvsMvAUpDJ91Ba001-jz38OAMk14n7YPsdrpi2C7Rsflpek_zYk4umq7fSfH82SKjeSdhjlCUqVilKxaywbXalH5_OBhVfvhupLWDv5wsTbIsbEu2rJNFWmdJBVUh-CpNRBEnnBfVcplWNQsV46BsiUcMKO3gkfgQKOMxw89XIEsaUxonCU1ommV5VBT5qkggYbnICibiYBHDlkkVjXEibZrQlD4ktohFo5J4eScjs1Y2HYAvGCt00im_OIOabcivDp56LAnE7H9AHvEAZDsoJ3039uA_gtyw6g84G_riS1_5Xys74WY>53155</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Unexpected formatting with multiple opening brackets
        </td>
    </tr>

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

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

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

<pre>
    Example code before formatting:
```cpp
void f() {
  {   // Comment
    { // Another comment
      int a;
      double b;
    }
  }
  {
    int c;
    double d;
  }
}
```

Code after running `clang-format test.cpp`
```cpp
void f() {
  { // Comment
   {// Another comment
    int a;
  double b;
}
}
{
  int c;
  double d;
}
}
```

clang-format version: `clang-format version 13.0.0`

Test files to reproduce:
[test-files.tar.gz](https://github.com/llvm/llvm-project/files/7854540/test-files.tar.gz)
[test-files.zip](https://github.com/llvm/llvm-project/files/7854541/test-files.zip)

Live example of this bug:
[cpp file](https://github.com/AMS21/Phi/blob/develop/tests/PhiCore/unittests/src/type_traits/is_invocable.test.cpp#L278)
[.clang-tidy](https://github.com/AMS21/Phi/blob/develop/.clang-format)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytlEuPnDAMgH8NXKJFEIYNHDjM7rSnrVSp7XkVwEDaDEFJmH38-jphHszMVttVKyHHsR3bfDFUqnkpPz3z7SiB1KoBUkGrNBAUW26tGLogXQfxJojXwW08P_U4zpadEg1pA5oHtCABu5utxKkEJf2MD7lX2y0M9uCbvXvfelC2B42VL2IIEYMlPEjvlrZGTRX2WZ2ZA7Y51V2oixCXqz47tM_ULIzHwyfl8ML7rZf3DhJvLXatp2FAQMQhkXzobmZoxIKxkYN0PPkhcn_g5qLeoXbJ7IrXG-94qn1J6YrRXxI6Y7EDbYQacIiuMO1dJEmjOLpM8h0ZklZIMMQqomHUqplqOA1jducw3_iQyHIdda9BtkGivbWjcXEeVidsP1URosKNlLvDcoMJf0JtcetT4MrybJWtYtSuM9PirbKvYvwvNZPzmi7tsaCXD2IHBPafqWqJ7YUh1dQtceBseWDvdrT-8o26il97gbKSqsKlgR1INe4bMbP7Hv8EqE2DsAer0bWLeRnh0WouvE2YRzHsVM1xXKLj8NP0gbJ8SS6ar9-K5uVfm4yWk4Q1wqZMmyIteGiFlVA6HsuIbEN-DPA8In1oFj838oRFyXaSVni0I_gvutK8_gXWhJOW5YcvVxgz-dvN0iTLwr5knAFvk4IVLK3qtuCsuG1TnqWrjMUVz0PJK5DGdR1QOsAT8SlQx8ZDUdKY0jhJaELTLGNRnrMiTyDhrMly3sTBKoYtFzJyfURKd6EufUs4IQadUuDdnZzcGNEN4CG5_HyyvdKlJx76wqVv_Dduxct_">