Re: [PATCH] c++: Quash bogus -Wredundant-move warning

2022-08-23 Thread Jason Merrill via Gcc-patches
On 8/22/22 17:10, Marek Polacek wrote: This patch fixes a pretty stoopid thinko. When I added code to warn about pessimizing std::move in initializations like T t{std::move(T())}; I also added code to unwrap the expression from { }. But when we have return {std::move(t)}; we cannot wa

[PATCH] c++: Quash bogus -Wredundant-move warning

2022-08-22 Thread Marek Polacek via Gcc-patches
This patch fixes a pretty stoopid thinko. When I added code to warn about pessimizing std::move in initializations like T t{std::move(T())}; I also added code to unwrap the expression from { }. But when we have return {std::move(t)}; we cannot warn about a redundant std::move because the