aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-06-04 15:06:44 +0100
committerJonathan Wakely <jwakely@redhat.com>2024-06-04 15:29:28 +0100
commitc6e6258ea43299399074f8d5f48697b5bc26064e (patch)
treecb350f08c62f9ea96ea370e07ed34c2333875512 /libstdc++-v3/include
parenta88e13bd7e0f50011e7f7f6e05c6f5e2a031143c (diff)
downloadgcc-c6e6258ea43299399074f8d5f48697b5bc26064e.zip
gcc-c6e6258ea43299399074f8d5f48697b5bc26064e.tar.gz
gcc-c6e6258ea43299399074f8d5f48697b5bc26064e.tar.bz2
libstdc++: Only define std::span::at for C++26 [PR115335]
In r14-5689-g1fa85dcf656e2f I added std::span::at and made the correct changes to the __cpp_lib_span macro (with tests for the correct value in C++20/23/26). But I didn't make the declaration of std::span::at actually depend on the macro, so it was defined for C++20 and C++23, not only for C++26. This fixes that oversight. libstdc++-v3/ChangeLog: PR libstdc++/115335 * include/std/span (span::at): Guard with feature test macro. (cherry picked from commit 2197814011eec75022aa8550f10621409b69d4a1)
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/std/span2
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span
index 43e9cf8..00fc527 100644
--- a/libstdc++-v3/include/std/span
+++ b/libstdc++-v3/include/std/span
@@ -287,6 +287,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return *(this->_M_ptr + __idx);
}
+#if __cpp_lib_span >= 202311L // >= C++26
[[nodiscard]]
constexpr reference
at(size_type __idx) const
@@ -296,6 +297,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"of size %zu"), __idx, this->size());
return *(this->_M_ptr + __idx);
}
+#endif
[[nodiscard]]
constexpr pointer