[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #9 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:6602a2b2dee16af6e2d451c704789356042b5881 commit r13-2096-g6602a2b2dee16af6e2d451c704789356042b5881 Author: Marek Polacek Date:

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-11 Thread herring at lanl dot gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #8 from S. Davis Herring --- I looked at P2266R3 again; it claims that the conversion function case (in #7) is actually covered by P1825R0. I think that case is questionable, since it still refers to "overload resolution to select

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-11 Thread herring at lanl dot gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #7 from S. Davis Herring --- > In the withMove case, in C++20, we issue: > warning: moving a local object in a return statement prevents copy elision > for > template Dest withMove(); > and: > warning: redundant move in return

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-04 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #6 from Marek Polacek --- The warning warns about dubious uses of std::move, so in the noMove case we won't warn at all since there's no std::move. In the withMove case, in C++20, we issue: warning: moving a local object in a return

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-04 Thread herring at lanl dot gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #5 from S. Davis Herring --- Perhaps I'm misunderstanding something, but your example (as well as compiling the original example with -std=c++20, which produces the same warning but now calls Dest(Dest&&) in the noMove case) means

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-04 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #4 from Marek Polacek --- (In reply to S. Davis Herring from comment #3) > Does this need to be language-version-dependent, given > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1825r0.html (in > C++20) and >

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-04 Thread herring at lanl dot gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #3 from S. Davis Herring --- Does this need to be language-version-dependent, given https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1825r0.html (in C++20) and

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2022-08-04 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 --- Comment #2 from Marek Polacek --- I've posted a patch for this: https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599342.html Sorry it's taken so long.

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2019-11-13 Thread herring at lanl dot gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 S. Davis Herring changed: What|Removed |Added CC||herring at lanl dot gov --- Comment

[Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization

2019-03-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89780 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|