Skip to content

Commit 9f27c4f

Browse files
Finally only 2 tests fail
1 parent ef90a64 commit 9f27c4f

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

libcxx/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ TEST_CONSTEXPR_CXX26 bool test() {
5353
assert(m[6] == 6.5);
5454
assert(m.size() == 2);
5555
}
56-
#ifndef FAKE_MACRO_NOOOOOO
57-
if (!TEST_IS_CONSTANT_EVALUATED)
56+
// #ifndef FAKE_MACRO_NOOOOOO
57+
#ifndef TEST_IS_CONSTANT_EVALUATED
5858
{
5959
// Use "container_test_types.h" to check what arguments get passed
6060
// to the allocator for operator[]

libcxx/test/support/container_test_types.h

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -317,27 +317,19 @@ class ContainerTestAllocator
317317

318318
template <class Up, class ...Args>
319319
void construct(Up* p, Args&&... args) {
320-
#if TEST_STD_VER >= 26
321-
if(TEST_IS_CONSTANT_EVALUATED) {
322-
323-
// TODO: This restriction relies on UB where std::__tree_node is not initialized
320+
// FIXME: This test relies on UB where std::__tree_node is not initialized
324321
// and only the "Container::value_type" is initialized
325322
// Need to figure out the right way to solve this without breaking both conditions
326-
// 1 of 2) Initializating tree_node in the __tree codebase
323+
// 1 of 2) Initializating tree_node in the __tree codebase (at constexpr time)
327324
// 2 of 2) Ensuring construct is only instantatiated for value_type
328325

329-
// static_assert((std::is_same<Up, AllowConstructT>::value),
330-
// "Only allowed to construct Up");
326+
// as the test in map/map.access/index_rv_key.pass.cpp (and others)
327+
// rely on a static object (so can't be used at constpex time)
328+
// so it is avoided at this moment
331329

332-
} else {
333-
#else
334330
static_assert((std::is_same<Up, AllowConstructT>::value),
335331
"Only allowed to construct Up");
336-
#endif
337332

338-
#if TEST_STD_VER >= 26
339-
}
340-
#endif
341333

342334
assert(controller->check<Args&&...>());
343335
{

0 commit comments

Comments
 (0)