On Wed, 20 Oct 2021 at 06:48, Tim Song wrote: > > On Tue, Oct 19, 2021 at 9:05 AM Jonathan Wakely via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > +constexpr bool > > +test_copy_elision() > > +{ > > + return true; > > +} > > + > > +static_assert( test_copy_elision() ); > > + > > This isn't much of a test :)
The ultimate copy elision. The copies even get removed from the source code. Thanks for spotting it. I meant to check we're constructing directly into the union member without materializing the temporary early. I'll add that today.