I have the following code that returns a warning C26478 with MSVC 1937 (with /W4
). However both clang and gcc (with -Wpedantic -Wextra -Wall
) are fine with this code.
std::tuple<int, int> i_make_tuples(){
return std::make_tuple(42,23);
}
int main() {
auto const [x,y] = i_make_tuples(); // C26478 (Don't use std::move on constant variables) reported here
}
Am I wrong or is this warning unjustified in this case?
This is indeed a false positive, which has been acknowledged as a bug by the MSVC developers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With