GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

libstdc++: Remove non-concepts fallback for make_shared_for_overwrite

The libstdc++ now requires compilers to support C++20 concepts for `std::make_shared_for_overwrite`.

The libstdc++ now requires C++20 concepts for std::make_shared_for_overwrite. The non-concepts fallback implementation is removed, simplifying the code. This change is possible because Clang 10 and later provide support for concepts.

In Details

This commit removes the fallback definition for _UnboundedArray, _BoundedArray, and _NotUnboundedArray in bits/shared_ptr.h, as well as the fallback declaration of _Sp_overwrite_tag partial specialization in bits/shared_ptr_base.h. These were used for C++20 compilers that did not define __cpp_concepts. Search snippets should focus on std::make_shared_for_overwrite and C++ concepts.

For Context

std::make_shared_for_overwrite is a C++20 feature that allocates memory for a shared object without initializing it, which can improve performance when the object will be immediately overwritten. C++ Concepts are a feature that allows the compiler to check that template arguments meet specific requirements. This commit removes a compatibility layer that was used when compilers didn't fully support Concepts, simplifying the implementation.

Filed Under: libstdc++C++20conceptsmemory management