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
#include <tuple>
#include <utility>
void conditional_use([[maybe_unused]] int && x) {
#ifdef USE_X
int y = std::move(x);
std::ignore = y;
#endif
}
int main() {
conditional_use(5);
}
results in the error
repro.cpp:4:46: error: rvalue reference parameter 'x' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved,-warnings-as-errors]
4 | void conditional_use([[maybe_unused]] int && x) {
Encountered on
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
$ clang-tidy --version
Ubuntu LLVM version 17.0.2
Optimized build.