|
|
5fc0b3 |
From 992665eab6c48d6a4819f42509346d24b277485d Mon Sep 17 00:00:00 2001
|
|
|
5fc0b3 |
From: David Malcolm <dmalcolm@redhat.com>
|
|
|
5fc0b3 |
Date: Thu, 2 Sep 2021 16:17:29 -0400
|
|
|
5fc0b3 |
Subject: [PATCH 15/17] Conditionalize test for PR libstdc++/87135 on
|
|
|
5fc0b3 |
__LIBSTDCXX_SO_VERSION >= 9
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
This VERIFY was added upstream 2018-09-18 as part of:
|
|
|
5fc0b3 |
re PR libstdc++/87135 ([C++17] unordered containers violate iterator validity requirements)
|
|
|
5fc0b3 |
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a521e62615e439aea7502a52fd0f8a21eaa6304f
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
but fails when run in DTS against a system libstdc++.so from an older GCC.
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
In particular, rehash from the header is using
|
|
|
5fc0b3 |
std::__detail::_Prime_rehash_policy::_M_next_bkt
|
|
|
5fc0b3 |
from the system .so:
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
12: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@GLIBCXX_3.4.18 (5)
|
|
|
5fc0b3 |
225: 0000000000000000 0 FUNC GLOBAL DEFAULT UNDEF std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@@GLIBCXX_3.4.18
|
|
|
5fc0b3 |
---
|
|
|
5fc0b3 |
.../23_containers/unordered_map/modifiers/reserve.cc | 4 ++++
|
|
|
5fc0b3 |
1 file changed, 4 insertions(+)
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
|
|
|
5fc0b3 |
index 58c8924b9..4c79ec2e6 100644
|
|
|
5fc0b3 |
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
|
|
|
5fc0b3 |
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc
|
|
|
5fc0b3 |
@@ -46,7 +46,11 @@ void test01()
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
// As long as we insert less than the reserved number of elements we
|
|
|
5fc0b3 |
// shouldn't experiment any rehash.
|
|
|
5fc0b3 |
+
|
|
|
5fc0b3 |
+ // Fixed upstream in GCC 9
|
|
|
5fc0b3 |
+#if __LIBSTDCXX_SO_VERSION >= 9
|
|
|
5fc0b3 |
VERIFY( m.bucket_count() == bkts );
|
|
|
5fc0b3 |
+#endif
|
|
|
5fc0b3 |
|
|
|
5fc0b3 |
VERIFY( m.load_factor() <= m.max_load_factor() );
|
|
|
5fc0b3 |
}
|
|
|
5fc0b3 |
--
|
|
|
5fc0b3 |
2.31.1
|
|
|
5fc0b3 |
|