Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information