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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] bit-field that has its size specified using a variable with `::` can be misformatted
        </td>
    </tr>

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

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

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

<pre>
    clang-format version 20.1.0 (https://github.com/llvm/llvm-project.git https://github.com/llvm/llvm-project/commit/24a30daaa559829ad079f2ff7f73eb4e18095f88) correctly formatted this code:
```
struct struct_with_constexpr {
  static constexpr unsigned int i_am_a_constexpr_lengthhhhh = 2;
};

struct foo {
 uint8_t i_am_a_bit_field_this_long
      : struct_with_constexpr::i_am_a_constexpr_lengthhhhh;
};
```
whereas clang-format version 21.1.0-rc3 (https://github.com/llvm/llvm-project.git https://github.com/llvm/llvm-project/commit/6096d35ea93c75f648a253a00775b4d74915c819) misformats it, breaking on the `::`
```
struct struct_with_constexpr {
 static constexpr unsigned int i_am_a_constexpr_lengthhhhh = 2;
};

struct foo {
  uint8_t i_am_a_bit_field_this_long : struct_with_constexpr::
 i_am_a_constexpr_lengthhhhh;
};
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8lMtu6zgMhp9G3hAJdLF8WXiRTpDXMGSJttUqViDJ6XSefiCnbdpBMef0LCoYkACD5E_-H6hitNOC2BH5QOSxUGuafegePbrZ66di8Oal004t02704awSXDFE6xfgdM_2FAhv5pQukYgD4SfCT5NN8zrstT8TfnLu-nbtLsE_ok77ySb4XgjhJ-3PZ5sfvFSCGqWUlG3DW2Vo3Y58HOuxFjiUyBrayrFpCG9B-xBQJ_cCN-0JDaTZRtDeYK5OD6Sirx89xBRWneB29c82zb32S0z49yUAqR8IPQDEpJLVcP-xLtsEDdglge3VuVf3sN7hMqU5HyDiCJyInIbUx9fHe9XR-7caq11S078nG2zqR4vO9Fl77_wybUryIeLwtd7cnTj8j5z_Cvkwh-cZA6oIX9vOsu27oMWPW1_RtjJComqFruVYlY3iUihK61oOpanLlkndsDZbf7bxJjxCjv0LhoDqyS4T-AXSjJBb3WZ06_m7HPwABr_Bwa_8z2n-gIHCdMK0olUFdqyWklFe1byYOy5bM5hWVkaJlgmKjJZy0AMKRkum6sJ2nHJJGyZYJRij-4pSyqipS6V53XJBSopnZd0-m7z3YSpsjCt2TIqybAqnBnRxW0acf-SPcJ7XU-g2OIZ1iqSkzsYU75mSTW5bZJ8C5REGm3bb5CDNKsGsMhQRov0HIV5Q29GigTVmPBRcVbBqcAh5op84Aa0WGPAOV0JTrMF132Z6azoSfnrt-9rxfwMAAP__eFDLCA">