Issue 126362
Summary Contradictory documentation for `[[unlikely]]`
Labels new issue
Assignees
Reporter Eisenwave
    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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to