libstdc++: Use consteval for _S_noexcept() helper functions

These _S_noexcept() functions are only used in noexcept-specifiers and
never need to be called at runtime. They can be immediate functions,
i.e. consteval.

libstdc++-v3/ChangeLog:

	* include/bits/iterator_concepts.h (_IterMove::_S_noexcept)
	(_IterSwap::_S_noexcept): Change constexpr to consteval.
	* include/bits/ranges_base.h (_Begin::_S_noexcept)
	(_End::_S_noexcept, _RBegin::_S_noexcept, _REnd::_S_noexcept)
	(_Size::_S_noexcept, _Empty::_S_noexcept, _Data::_S_noexcept):
	Likewise.
	* include/std/concepts (_Swap::_S_noexcept): Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
This commit is contained in:
Jonathan Wakely
2025-09-11 09:55:12 +01:00
committed by Jonathan Wakely
parent f463e6bd8e
commit d99c6786c3
3 changed files with 10 additions and 10 deletions

View File

@@ -148,7 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__adl_imove<_Tp>)
@@ -884,7 +884,7 @@ namespace ranges
{
private:
template<typename _Tp, typename _Up>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__adl_iswap<_Tp, _Up>)

View File

@@ -106,7 +106,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (is_array_v<remove_reference_t<_Tp>>)
@@ -157,7 +157,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (is_bounded_array_v<remove_reference_t<_Tp>>)
@@ -214,7 +214,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__member_rbegin<_Tp>)
@@ -272,7 +272,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__member_rend<_Tp>)
@@ -342,7 +342,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (is_bounded_array_v<remove_reference_t<_Tp>>)
@@ -422,7 +422,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__member_empty<_Tp>)
@@ -468,7 +468,7 @@ namespace ranges
{
private:
template<typename _Tp>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__member_data<_Tp>)

View File

@@ -204,7 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
private:
template<typename _Tp, typename _Up>
static constexpr bool
static consteval bool
_S_noexcept()
{
if constexpr (__adl_swap<_Tp, _Up>)