<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJzVVUtzmzAQ_jXiookHhDH2gQPE9cmdHNI2ZyEWUCJLVBJ18u-7yHYT5zWZaXvIDCNpte_9llVtmofiu5O6o9vtj6_U-QcFhF1SY6kwupUdSUsSr0lckkV8_AJZcQfNlb4OCmkZ1I8cC_yugtZYqCwX4Cb25ei82Z0E8PbG8mFAv3_sU1q2Huxm1MJLoyellisHB26plNlf98b6Shlx5650eY3aCrZSw5uyW2OGd0WfJXVYv_XSUa4wjeaBYho77j00WI8G3qoGSlHCllJ73MphqiDuP0la0QFPCUnX9EThcbgg6RcN956wFSV5dbSZr48HtkFtYXY70Cgy0fQfewjrvpcKPmD1qQn6wkH6kfD_l6vX8OvAuye4efN5UfskeL3ig76P0U0Pmo5h8CDnxZ_v7Qh4T6WmvofTKMIQpKfP4OWOwv0AAs-TAAYueup6s3eoyn0w_-7wQDdcN-dyrwyOScwCHfWIg28WNUXarNIVj_joUaPY3Y22gdtotKrovR-mqRcKu-mk78d6hvVFQqlfp-1isOYW40ZSOjfinGSbLM2zZdQXCczb-ULEKc-W83rRMC6SRLR1nsVNzFsWKV6DcgXJKsJYPWJt2AEhJhTX3cWhPtNtto7-PiJZsJjhlyRJmq6ybJYs8jRneSayZb1YCCDzGHZcqtlkZ2ZsF9kimMTYHDKVdN49MrlzstMAIQGM0EuvAnEWfbamExC0Ds8I3WPYVOFUnrrm2K4ugLKfHpOpF4QwNrC9oWfPzOysxaKQXhFy-w2T9wXi>53758</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Loop braces with leading comments are wrapped according to BraceWrapping.AfterFunction
        </td>
    </tr>

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

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

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

<pre>
    Using LLVM style, or config:
```
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  AfterFunction: false
AllowShortBlocksOnASingleLine: false
AllowShortLoopsOnASingleLine: false
```

This already formatted code:
```
for (int *p, *q; p != q; p = p->next) {
}
/*comment*/ for (int *p, *q; p != q; p = p->next) {
}

while (int *p, *q; p != q) {
  p = p->next;
}
/*comment*/ while (int *p, *q; p != q) {
  p = p->next;
}
```

gets formatted to:
```
for (int *p, *q; p != q; p = p->next) {
}
/*comment*/ for (int *p, *q; p != q; p = p->next) {}

while (int *p, *q; p != q) {
  p = p->next;
}
/*comment*/ while (int *p, *q; p != q) { p = p->next; }
```

When using `AfterFunction: true` in the config, it gets formatted as expected, which shows that `AllowShortBlocksOnASingleLine` and `AllowShortLoopsOnASingleLine` are unused.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVEtzmzAQ_jXioonHFgaHAweI65M7ObhtzkKsQYksUUnU8b_vSrbbOK_JoT1k0CCtdvfbF3yNaQ_ldyd1R9frH1-p8wcFhN1QY6kweis7klZkuiTTiuTT04pizR20t3oTHdIqup80FvhDDVtjobZcgAvqm9F5szsb4O2d5cOAcf_gU1ptPdjVqIWXRgenLVcOjtpKKbPf9Mb6Whnx4G51tUFvBWup4U3btTHDu6bPijq-v_XSUa6wjPZAsYwd9x5a7EcLb3UDrShh11J73KohdBD3nySt6YCnGUmX9Czhcbgi6RcNj56wgpJFfcJcLE8HtkJvYXY70GgSZPqPI8T3vpcKPoD6FIK-CJB-JP3_Feq1-XXg3ZO5efN5p_ZJ5vVKDPr-jO560HSMxIOaF3--tyPgPZWa-h7OVIQpSE-fjZc7Co8DCDwHA0xc9NT1Zu_QlfsI_y55YBiu20u7V4gjmFmgox6R-CZJW6ZtkRY88dIrKElWC8V1d3VMjGRLGjBoExmQ7qXvqUJCCQWfOu0i3j7wYChDCGOj2ht6wZCTi-4ko1Vl7_0QaDVObtUh-NhMEBYFpX6dt6vBmntsDIrSuRGJmK2ydJFdJ3053-bARJNlgvH5tshZXsxFgY-YspY1eaJ4A8qFughjzYjNZ8dPgF3UibfZMpElmzJcs9ksTYssm8zyRbpgi0xk102eCyDzKey4VJOQ18TYLrFlTBGRHSqVdN79VXLnZKchtjXg89HjVMrdw2hbuE9iNWUs5TfuavBG">