<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/126362>126362</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Contradictory documentation for `[[unlikely]]`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Eisenwave
</td>
</tr>
</table>
<pre>
https://clang.llvm.org/docs/AttributeReference.html#likely-and-unlikely contains these two examples:
```cpp
if (b) {
[[unlikely]] --b; // In the path of execution,
// this branch is considered unlikely.
}
```
```cpp
if (b) {
[[unlikely]] b++; // Placement on the second statement in the branch.
} // The attribute will be ignored.
```
This is a direct contradiction. Was the first example meant to `if (b) [[unlikely]] {`?
Furthermore, the whole likely/unlikely documentation is copied and pasted for the `[[likely]]` and `[[unlikely]]` attributes, which doesn't seem intentional.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyclE-PmzAQxT-NuYyCjEkgHDgkmyL1VlUr9ew_Q3BrbGSbze63rwxJdpt2L40sRdh43u_Nw-Yh6LNFbMnuSHanjM9xcL79ogPaC3_BTDj11g4xToGUB8I6wjppuD3nxryMufNnwjrlZCCsO8TotZgjfscePVqJ-RBHQ1hp9C80bxtu1Wa26wNIZyPXNkAcMCDEiwN85eNkcFGiB1LRdchpIvSgeyBsLwhrgNRHQg8AC_PxVpHsTmR3gs1GkPIIKyp8tak-TDwO4HrAV5Rz1M4S9rSU-Pt33RgHHUB4buUAOiTaoBV6VHDTyxNjffpI-v_UgrBjGu_k3wyXOKKN4FYPAaWzCkLkcZ3X6_wKeaX53NDzgMBvCcFFGwMCQZ-t86jyBxfPyb0OwEFpjzIuaXmutEzNy-EHX3KDXvsQb7nBiNxGiA5IRT8a_5fh1I2KkrJLyvTQzT4O6EfnkbCnpfZlcAbhuol19w9HOTkn_zyhrNlMGhVwq2DiIaKC3vmlRFJYxD9Kk4ou794X_yRblm99CgnmMmg5gHIYLGF1hIA4grYRbSLgJs9UW6qmbHiGbVGXDaUVY9tsaHFX96JpRKVK3mO9pfuiqMqiUFXVNPu-yXTLKNtRRve0KWq6zdVeiKbu6Z4XWym5IFuKI9fmftwyHcKMbcGqsmKZ4QJNWA4vYxYvsKwSxtJZ9m3atBHzOZAtNTrE8F4m6miwfbrH6vxjZ1MTP-9RNnvzcC-cdRxmkUs3EtYloevfZvLuJ8pIWLfgpbviyv_Sst8BAAD__1BtZGs">