aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-09-11 09:55:12 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2025-09-11 14:38:59 +0100
commitd99c6786c3ea083cdc70fa012674db58cc91079f (patch)
treeb09616eabce40d04924f8681da1b9ac977331432
parentf463e6bd8e84f12bde60f3e24e2d30da7fcda419 (diff)
downloadgcc-d99c6786c3ea083cdc70fa012674db58cc91079f.zip
gcc-d99c6786c3ea083cdc70fa012674db58cc91079f.tar.gz
gcc-d99c6786c3ea083cdc70fa012674db58cc91079f.tar.bz2
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>
-rw-r--r--libstdc++-v3/include/bits/iterator_concepts.h4
-rw-r--r--libstdc++-v3/include/bits/ranges_base.h14
-rw-r--r--libstdc++-v3/include/std/concepts2
3 files changed, 10 insertions, 10 deletions
diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h
index 979039e..fd91b22 100644
--- a/libstdc++-v3/include/bits/iterator_concepts.h
+++ b/libstdc++-v3/include/bits/iterator_concepts.h
@@ -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>)
diff --git a/libstdc++-v3/include/bits/ranges_base.h b/libstdc++-v3/include/bits/ranges_base.h
index 691a181..2782908 100644
--- a/libstdc++-v3/include/bits/ranges_base.h
+++ b/libstdc++-v3/include/bits/ranges_base.h
@@ -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>)
diff --git a/libstdc++-v3/include/std/concepts b/libstdc++-v3/include/std/concepts
index 5899f03..d9920a8 100644
--- a/libstdc++-v3/include/std/concepts
+++ b/libstdc++-v3/include/std/concepts
@@ -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>)