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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] incorrect sorting of using declarations if multiple scope operators are present in the declaration
        </td>
    </tr>

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

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

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

<pre>
    When formatting the following piece of code 
```
using boost::regex;
using boost::regex_constants::icase;
using std::chrono::duration_cast;
using std::chrono::microseconds;
using std::chrono::seconds;
using std::chrono::steady_clock;
using std::move;
using std::string;
```
clang-format produces
```
using boost::regex;
using boost::regex_constants::icase;
using std::move;
using std::string;
using std::chrono::duration_cast;
using std::chrono::microseconds;
using std::chrono::seconds;
using std::chrono::steady_clock;
```

but `std::move` and `std::string` should be placed after the `std::chrono` declarations. This only happens when there are multiple `::` in the declaration. Observed with clang-format 13.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVMFunDAQ_RpzGWVl7IUsBw6Jor32UqnHyNgDuPV6kMdkm7-vgFWziZq2OVWVEGDPmye_N54xzH6IiK2o7kX1UJg5j5TaiYJJnutG66Ij99x-GTFCT-lkcvZxgDwi9BQCnZfV5NEiUA-WHIKQD0LeiVpennU58wLsiDgLfSf0XcIBvwt9_7vwo6XI2cTM26a3hvFNDme3Be2YKNL27-Zksqf4aM1C-OeEk7eJGC1Fx3-D_wg0o3HPjzaQ_fYe_kRP7-rinHwcfkbf-GqDicPNVhmYErnZIv-jCnxAxf9cuze-bu9uziBq-dqLWoKJ7tX-xYdaAo80BwcdwhSMRQemz5jWzrpOuBynluDQBrN5wzv4PHoGiuEZRjNNGBnOS4_mEROCSQinOWQ_hZVto1pI_Aq55trBp44xPaGDs88jvLpRpd4VrtWu0Y0psC3rW73XzaFSxdiWt2W_bw627q27PbhGKlP2FWJX9rKxVVX4VkmlZVmWpVL7Uu1QYiX7XimtDg0etNhLPBkfdiE8nXaUhsIzz9hWTaNlEUyHgdfJpFTEM6xBodQyqFK75Nx088BiL4PnzC8s2eewjrRrLaJ6AB8tpYQ2A1NaBxn1sNX_2l3w_Yt9bGlCoAmTyZR49XZKyBjzL9ws5hTaMedpbRh1FOo4-DzO3c7SSajjcsbL52ZK9BVtFuq4KmOhjqvyHwEAAP__JhXF5Q">