https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91243
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Status|WAITING |NEW --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think it's caused by a compiler bug though. For C++17 and up, G++ doesn't object to returning a non-destructible type unless the temporary gets materialized.