[PATCH] libstdc++: Make ranges::construct_at constexpr-friendly [PR95788]

Jonathan Wakely jwakely@redhat.com
Thu Oct 8 20:53:43 GMT 2020


On 07/10/20 12:10 -0400, Patrick Palka via Libstdc++ wrote:
>On Wed, 30 Sep 2020, Patrick Palka wrote:
>
>> This rewrites ranges::construct_at in terms of std::construct_at so
>> that we can piggy back on the compiler's existing support for
>> recognizing placement new within std::construct_at during constexpr
>> evaluation instead of having to additionally teach the compiler about
>> ranges::construct_at.
>>
>> While we're here, we should also make ranges::construct_at conditionally
>> noexcept like std::construct_at.
>>
>> Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
>>
>> libstdc++-v3/ChangeLog:
>>
>> 	PR libstdc++/95788
>> 	* include/bits/ranges_uninitialized.h:
>> 	(__construct_at_fn::operator()): Just call std::construct_at.
>> 	Declare it conditionally noexcept.
>> 	* testsuite/20_util/specialized_algorithms/construct_at/95788.cc:
>> 	New test.
>
>Here's an updated patch that std::-qualifies the calls to declval in its
>function signature and adjusts formatting accordingly:

OK for trunk and gcc-10, thanks.



More information about the Libstdc++ mailing list