// PR c++/86981 // { dg-do compile { target c++17 } } // { dg-options "-Wpessimizing-move" } #include #include struct T { T() { } T(const T&) { } T(T&&) { } }; std::optional fn () { T t; return std::move (t); }