aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-09-17 12:27:02 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-09-17 20:43:34 +0100
commit1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61 (patch)
tree7985855213466a319a42267279bee1a13a4b5b60
parent2961ac45b9e19523958757e607d11c5893d6368b (diff)
downloadgcc-1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61.zip
gcc-1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61.tar.gz
gcc-1fa2c5a695bb962ffcf8abed49f69cdcc59d0e61.tar.bz2
libstdc++: Fix last std::tuple constructor missing 'constexpr' [PR102270]
Also rename the test so it actually runs. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/102270 * include/std/tuple (_Tuple_impl): Add constexpr to constructor missed in previous patch. * testsuite/20_util/tuple/cons/102270.C: Moved to... * testsuite/20_util/tuple/cons/102270.cc: ...here. * testsuite/util/testsuite_allocator.h (SimpleAllocator): Add constexpr to constructor so it can be used for C++20 tests.
-rw-r--r--libstdc++-v3/include/std/tuple1
-rw-r--r--libstdc++-v3/testsuite/20_util/tuple/cons/102270.cc (renamed from libstdc++-v3/testsuite/20_util/tuple/cons/102270.C)3
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_allocator.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 6f0dc63..120c80a 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -330,6 +330,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ }
template<typename _Alloc>
+ _GLIBCXX20_CONSTEXPR
_Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
const _Head& __head, const _Tail&... __tail)
: _Inherited(__tag, __a, __tail...),
diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/102270.C b/libstdc++-v3/testsuite/20_util/tuple/cons/102270.cc
index 9983298..5500cac 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/cons/102270.C
+++ b/libstdc++-v3/testsuite/20_util/tuple/cons/102270.cc
@@ -56,6 +56,9 @@ constexpr bool construct_using_allocator()
std::tuple<X1a, X1a, X1b, X1b> t1a1b(std::allocator_arg, a, 1, i, 1, i);
+ const int c = 0;
+ std::tuple<int, int> tii(std::allocator_arg, a, c, c);
+
return true;
}
static_assert( construct_using_allocator() );
diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h
index 1f7912e..b5b4028 100644
--- a/libstdc++-v3/testsuite/util/testsuite_allocator.h
+++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h
@@ -514,7 +514,7 @@ namespace __gnu_test
{
typedef Tp value_type;
- SimpleAllocator() noexcept { }
+ constexpr SimpleAllocator() noexcept { }
template <class T>
SimpleAllocator(const SimpleAllocator<T>&) { }