Open
Description
Minimal reproducer https://godbolt.org/z/PoboWj4PM:
#include <tuple>
#include <utility>
#include <string>
std::pair<std::string, std::string> foo(std::string a, std::string b) {
return std::make_pair(std::move(a), std::move(b));
}
void bar(std::string a, std::string b) {
std::tie(a, b) = foo(std::move(a), std::move(b));
std::tie(a, b) = foo(std::move(a), std::move(b));
}
/**
test.cpp:11:34: warning: 'a' used after it was moved [bugprone-use-after-move]
11 | std::tie(a, b) = foo(std::move(a), std::move(b));
| ^
test.cpp:10:24: note: move occurred here
10 | std::tie(a, b) = foo(std::move(a), std::move(b));
| ^
test.cpp:11:48: warning: 'b' used after it was moved [bugprone-use-after-move]
11 | std::tie(a, b) = foo(std::move(a), std::move(b));
| ^
test.cpp:10:38: note: move occurred here
10 | std::tie(a, b) = foo(std::move(a), std::move(b));
| ^
**/