You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
io_queue: fix static member access to comply with CWG2813
Fix build failure with recent Clang implementations of CWG2813, which
makes accessing static members through instance expressions into
discarded-value expressions. This caused nodiscard warnings when
accessing static member `tokens_capacity()` through `fgs[i]`.
Before:
```c++
fgs[i].tokens_capacity() // Warns: ignoring nodiscard return value
```
After:
```c++
const auto& fg = fgs[i]); // not discarded
fg.tokens_capacity(); // access static member function
```
Additionally, this refactoring reduces repetition of `fgs[g_idx]`
expressions throughout the code.
See:
- https://cplusplus.github.io/CWG/issues/2813.html
- https://eel.is/c++draft/expr.ref#2
Fixes Scylla build failure with the latest Clang, as Scylla enables
Seastar_UNUSED_RESULT_ERROR.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
0 commit comments