[gcc r17-354] libstdc++: Remove non-concepts fallback for std::make_shared_for_overwrite
Jonathan Wakely
redi@gcc.gnu.org
Wed May 6 12:18:45 GMT 2026
https://gcc.gnu.org/g:5d225c5aa3d40cbf479d99c0bb2ca22291a11568
commit r17-354-g5d225c5aa3d40cbf479d99c0bb2ca22291a11568
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue May 5 14:03:04 2026 +0100
libstdc++: Remove non-concepts fallback for std::make_shared_for_overwrite
Clang 10 added support for concepts, so we no longer need to support
C++20 compilers that don't define __cpp_concepts.
libstdc++-v3/ChangeLog:
* include/bits/shared_ptr.h (_UnboundedArray, _BoundedArray)
(_NotUnboundedArray): Remove fallback definition for C++20
compilers that don't define __cpp_concepts.
* include/bits/shared_ptr_base.h (_Sp_counted_ptr_inplace):
Remove fallback declaration of _Sp_overwrite_tag partial
specialization.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Diff:
---
libstdc++-v3/include/bits/shared_ptr.h | 18 ------------------
libstdc++-v3/include/bits/shared_ptr_base.h | 5 -----
2 files changed, 23 deletions(-)
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index fd00384df223..ada32d3d3cb9 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -114,38 +114,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __glibcxx_shared_ptr_arrays >= 201707L
// Constraint for overloads taking array types with unknown bound, U[].
-#if __cpp_concepts
template<typename _Tp>
requires is_array_v<_Tp> && (extent_v<_Tp> == 0)
using _UnboundedArray = _Tp;
-#else
- template<typename _Tp>
- using _UnboundedArray
- = __enable_if_t<__is_array_unknown_bounds<_Tp>::value, _Tp>;
-#endif
// Constraint for overloads taking array types with known bound, U[N].
-#if __cpp_concepts
template<typename _Tp>
requires (extent_v<_Tp> != 0)
using _BoundedArray = _Tp;
-#else
- template<typename _Tp>
- using _BoundedArray
- = __enable_if_t<__is_array_known_bounds<_Tp>::value, _Tp>;
-#endif
#if __glibcxx_smart_ptr_for_overwrite
// Constraint for overloads taking either non-array or bounded array, U[N].
-#if __cpp_concepts
template<typename _Tp>
requires (!is_array_v<_Tp>) || (extent_v<_Tp> != 0)
using _NotUnboundedArray = _Tp;
-#else
- template<typename _Tp>
- using _NotUnboundedArray
- = __enable_if_t<!__is_array_unknown_bounds<_Tp>::value, _Tp>;
-#endif
#endif // smart_ptr_for_overwrite
#endif // shared_ptr_arrays
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index b92e3a4c90e4..cfaee6df37b1 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -727,14 +727,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Partial specialization used for make_shared_for_overwrite<non-array>().
// This partial specialization is used when the allocator's value type
// is the special _Sp_overwrite_tag type.
-#if __cpp_concepts
template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
requires is_same_v<typename _Alloc::value_type, _Sp_overwrite_tag>
class _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> final
-#else
- template<typename _Tp, template<typename> class _Alloc, _Lock_policy _Lp>
- class _Sp_counted_ptr_inplace<_Tp, _Alloc<_Sp_overwrite_tag>, _Lp> final
-#endif
: public _Sp_counted_base<_Lp>
{
[[no_unique_address]] _Alloc _M_alloc;
More information about the Libstdc++-cvs
mailing list