[gcc r15-1450] libstdc++: Add conditional noexcept to std::pair default ctor
Jonathan Wakely
redi@gcc.gnu.org
Wed Jun 19 16:35:31 GMT 2024
https://gcc.gnu.org/g:9651d6005f9c1ac60aecf7b36d6c0bd1ead8a63b
commit r15-1450-g9651d6005f9c1ac60aecf7b36d6c0bd1ead8a63b
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Jun 18 20:57:24 2024 +0100
libstdc++: Add conditional noexcept to std::pair default ctor
Most of std::pair constructors implemented using C++20 concepts have a
conditional noexcept-specifier, but the default constructor doesn't.
This fixes that.
libstdc++-v3/ChangeLog:
* include/bits/stl_pair.h [__cpp_lib_concepts] (pair()): Add
conditional noexcept.
Diff:
---
libstdc++-v3/include/bits/stl_pair.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index 0c1e5719a1a3..0d60eaba1941 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -344,6 +344,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit(__not_<__and_<__is_implicitly_default_constructible<_T1>,
__is_implicitly_default_constructible<_T2>>>())
pair()
+ noexcept(is_nothrow_default_constructible_v<_T1>
+ && is_nothrow_default_constructible_v<_T2>)
requires is_default_constructible_v<_T1>
&& is_default_constructible_v<_T2>
: first(), second()
More information about the Gcc-cvs
mailing list