https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61909
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- This is by design. I have a patch to do the optimization a bit more aggressively, but still only for trivially copyable types and others known to be location invariant (which should include lambdas)