https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121433
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #1) > GCC implements CWG 1579 so the conversion to std::optional<std::string> is > OK and the implicit move still kicks in. i.e. https://cplusplus.github.io/CWG/issues/1579.html which was motivated by precisely the case of returning optional<T> initialized by an lvalue of type T.