https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91217
Bug ID: 91217 Summary: Returning std::array from lambda results in an extra copy step on return Product: gcc Version: 8.1.0 URL: https://godbolt.org/z/3zAhtv Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: milasudril at gmail dot com Target Milestone: --- Target: ARM, x86-64 It appears that for GCC versions later than or equal to version 8.1, an extra copy procedure when an std::array is being returned from a lambda. The problem does not exist for an immediately created function object. Not affected: GCC 7.4 Affected: GCC 8.1 up to and including trunk.