On Wed, 20 Oct 2021 at 09:42, Jonathan Wakely wrote: > > 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 > > 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. Fixed by the attached patch. Tested x86_64-linux, pushed to trunk. Thanks again!