[PATCH] c++, libstdc++: Implement C++26 P3074R7, P3726R0 and CWG3189 - trivial unions [PR119059]

Jonathan Wakely jwakely@redhat.com
Wed May 20 12:12:57 GMT 2026


On Wed, 20 May 2026 at 13:00, Tomasz Kaminski <tkaminsk@redhat.com> wrote:
> On Wed, May 20, 2026 at 10:44 AM Jakub Jelinek <jakub@redhat.com> wrote:
>> --- libstdc++-v3/include/std/memory.jj  2026-05-19 09:11:42.854346321 +0200
>> +++ libstdc++-v3/include/std/memory     2026-05-19 16:08:08.038949038 +0200
>> @@ -126,6 +126,7 @@
>>  #define __glibcxx_want_transparent_operators
>>  #define __glibcxx_want_smart_ptr_owner_equality
>>  #define __glibcxx_want_allocate_at_least
>> +#define __glibcxx_want_start_lifetime
>>  #include <bits/version.h>
>>
>>  #if __cplusplus >= 201103L && __cplusplus <= 202002L && _GLIBCXX_HOSTED
>> @@ -175,6 +176,28 @@ _GLIBCXX_END_NAMESPACE_VERSION
>>  } // namespace
>>  #endif // C++11 to C++20
>>
>> +#if __glibcxx_start_lifetime >= 202603L // C++ >= 26
>> +namespace std _GLIBCXX_VISIBILITY(default)
>> +{
>> +_GLIBCXX_BEGIN_NAMESPACE_VERSION
>> +
>> +  template <class _Tp>
>> +    constexpr void
>> +    start_lifetime(_Tp& __r) noexcept
>
> Could you move the declaration to libstdc++-v3/include/bits/stl_construct.h,
> (we start_lifetime_as, cosntruct_as is). We do not not want  to include whole header.

Ah yes, good point.



More information about the Libstdc++ mailing list