Open firewave opened 2 months ago
@llvm/issue-subscribers-clang-tidy
Author: Oliver Stöneberg (firewave)
The suggestion is this:
@@ -13,6 +13,6 @@
{
std::list<std::string> l;
std::vector<S> v;
- v.push_back({std::move(l)});
+ v.emplace_back(std::move(l));
}
Which does compile (even when automatically fixed with -fix
): https://godbolt.org/z/5PvWMrYrE
Uh, that is very subtle.
https://godbolt.org/z/33981TM1n
Fixing it as suggested will lead the following error:
https://godbolt.org/z/vz1shKrvf