Skip to content

Commit adc5f50

Browse files
insert_range.pass.cpp, empty passes, stuck at next
1 parent a205de2 commit adc5f50

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

libcxx/include/__tree

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,14 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
16521652
template <class _Tp, class _Compare, class _Allocator>
16531653
_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::~__tree() {
16541654
static_assert(is_copy_constructible<value_compare>::value, "Comparator must be copy-constructible.");
1655-
destroy(__root());
1655+
// TODO: get this verified
1656+
// without this check, constexpr evaluation goes into infinite recursion, for
1657+
// insert_range.pass.cpp:EmptyContainer_EmptyRange
1658+
1659+
// not sure if this is UB ?, if not, we need to add is_constant_evaluated()
1660+
if(size() > 0) {
1661+
destroy(__root());
1662+
}
16561663
}
16571664

16581665
template <class _Tp, class _Compare, class _Allocator>

libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
1010
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
1111
// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
12+
// ADDITIONAL_COMPILE_FLAGS: -fconstexpr-backtrace-limit=5 -fconstexpr-depth=120000
1213

1314
// <map>
1415

libcxx/test/std/containers/insert_range_maps_sets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ TestCaseMapSet<std::pair<K, V>> constexpr NElementsContainer_RangeWithDuplicates
200200
{16, 'D'}}};
201201

202202
template <class Container, class T, class Iter, class Sent>
203-
void test_map_set_insert_range(bool allow_duplicates = false) {
203+
TEST_CONSTEXPR_CXX26 void test_map_set_insert_range(bool allow_duplicates = false) {
204204
auto test = [&](const TestCaseMapSet<T>& test_case, bool check_multi = false) {
205205
Container c(test_case.initial.begin(), test_case.initial.end());
206206
auto in = wrap_input<Iter, Sent>(test_case.input);

0 commit comments

Comments
 (0)