From 4c0e46506cfd04390f70e25f98cd4b6aab5c63aa Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Wed, 30 Apr 2025 19:37:56 +0300 Subject: [PATCH 1/4] ``: explain test failures caused by move Co-authored-by: seishun --- tests/libcxx/expected_results.txt | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 3625b6763d3..830756248f6 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -236,17 +236,10 @@ std/strings/c.strings/cuchar.compile.pass.cpp FAIL std/containers/container.adaptors/flat.map/flat.map.cons/deduct.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/deduct.pass.cpp FAIL -# FIXME! Assertion failed: mo.empty() -std/containers/container.adaptors/flat.map/flat.map.cons/move_alloc.pass.cpp FAIL -std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_alloc.pass.cpp FAIL - -# FIXME! Assertion failed: m.keys().size() == m.values().size() -std/containers/container.adaptors/flat.map/flat.map.cons/move_assign_clears.pass.cpp FAIL -std/containers/container.adaptors/flat.map/flat.map.cons/move_exceptions.pass.cpp FAIL -std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_assign_clears.pass.cpp FAIL -std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_exceptions.pass.cpp FAIL - # FIXME! abort() has been called +# caused by insert failing when called on a moved-from flat_map due to its comparator being moved from, +# but this seems to be in line with the specification: flat_map::insert transitively requires that the comparator +# "induce a strict weak ordering on the values" std/containers/container.adaptors/flat.map/flat.map.cons/move.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move.pass.cpp FAIL @@ -591,6 +584,18 @@ std/depr/depr.c.headers/stddef_h.compile.pass.cpp:1 FAIL # *** LIKELY BOGUS TESTS *** +# A moved-from flat_map is not empty, which doesn't seem to be required +std/containers/container.adaptors/flat.map/flat.map.cons/move_alloc.pass.cpp FAIL +std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_alloc.pass.cpp FAIL + +# A moved-from flat_map is not meeting the first invariant, but this seems to also be a specification issue: +# [flat.map.defn] doesn't declare a move constructor, which seems to imply that moving from a flat_map should behave +# as if the move constructor were implicitly defined, i.e. it can't restore the invariants +std/containers/container.adaptors/flat.map/flat.map.cons/move_assign_clears.pass.cpp FAIL +std/containers/container.adaptors/flat.map/flat.map.cons/move_exceptions.pass.cpp FAIL +std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_assign_clears.pass.cpp FAIL +std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_exceptions.pass.cpp FAIL + # Test bug after LWG-2899 "is_(nothrow_)move_constructible and tuple, optional and unique_ptr" was accepted. std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp FAIL std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp FAIL From 20f6068cc2a2292375b2182affd012590e17d9de Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Wed, 30 Apr 2025 20:13:55 +0300 Subject: [PATCH 2/4] mention P3567R0 --- tests/libcxx/expected_results.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 830756248f6..ff994bd0f1d 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -237,8 +237,8 @@ std/containers/container.adaptors/flat.map/flat.map.cons/deduct.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/deduct.pass.cpp FAIL # FIXME! abort() has been called -# caused by insert failing when called on a moved-from flat_map due to its comparator being moved from, -# but this seems to be in line with the specification: flat_map::insert transitively requires that the comparator +# caused by insert failing when called on a moved-from flat_map due to its comparator being moved from, +# but this seems to be in line with the specification: flat_map::insert transitively requires that the comparator # "induce a strict weak ordering on the values" std/containers/container.adaptors/flat.map/flat.map.cons/move.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move.pass.cpp FAIL @@ -588,9 +588,10 @@ std/depr/depr.c.headers/stddef_h.compile.pass.cpp:1 FAIL std/containers/container.adaptors/flat.map/flat.map.cons/move_alloc.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_alloc.pass.cpp FAIL -# A moved-from flat_map is not meeting the first invariant, but this seems to also be a specification issue: +# A moved-from flat_map is not meeting the first invariant, but this seems to also be a specification issue: # [flat.map.defn] doesn't declare a move constructor, which seems to imply that moving from a flat_map should behave # as if the move constructor were implicitly defined, i.e. it can't restore the invariants +# P3567R0 adds a move constructor that moves the comparator std/containers/container.adaptors/flat.map/flat.map.cons/move_assign_clears.pass.cpp FAIL std/containers/container.adaptors/flat.map/flat.map.cons/move_exceptions.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_assign_clears.pass.cpp FAIL From 44636fa6f2bcbcd6954d0b1fdf84645b99a81cbf Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Thu, 1 May 2025 09:42:14 +0300 Subject: [PATCH 3/4] expand explaination also treat invariant test as non-bogus --- tests/libcxx/expected_results.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index ff994bd0f1d..0a685effdc6 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -236,10 +236,23 @@ std/strings/c.strings/cuchar.compile.pass.cpp FAIL std/containers/container.adaptors/flat.map/flat.map.cons/deduct.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/deduct.pass.cpp FAIL +# FIXME! Assertion failed: m.keys().size() == m.values().size() +# [flat.map.defn] doesn't declare a move constructor, which seems to imply that moving from a flat_map should behave +# as if the move constructor were implicitly defined, i.e. it can't restore the invariants +# P2767R2 does not specify move constructor, which is broken +# P3567R0 adds a move constructor that asks to restore invariants +# P3567R0 constructor also moves comparator, which we should veto if it makes into the Standard +std/containers/container.adaptors/flat.map/flat.map.cons/move_assign_clears.pass.cpp FAIL +std/containers/container.adaptors/flat.map/flat.map.cons/move_exceptions.pass.cpp FAIL +std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_assign_clears.pass.cpp FAIL +std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_exceptions.pass.cpp FAIL + # FIXME! abort() has been called # caused by insert failing when called on a moved-from flat_map due to its comparator being moved from, # but this seems to be in line with the specification: flat_map::insert transitively requires that the comparator # "induce a strict weak ordering on the values" +# P2767R2 does not specify move constructor, which is broken +# P3567R0 constructor is still asked to move comparator, which is also broken std/containers/container.adaptors/flat.map/flat.map.cons/move.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move.pass.cpp FAIL From 8f9d2633d8bae2c3e2f991ae5d53b5836644e1db Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Thu, 1 May 2025 09:44:25 +0300 Subject: [PATCH 4/4] non-bougs now --- tests/libcxx/expected_results.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 0a685effdc6..53cbe6b72d7 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -601,15 +601,6 @@ std/depr/depr.c.headers/stddef_h.compile.pass.cpp:1 FAIL std/containers/container.adaptors/flat.map/flat.map.cons/move_alloc.pass.cpp FAIL std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_alloc.pass.cpp FAIL -# A moved-from flat_map is not meeting the first invariant, but this seems to also be a specification issue: -# [flat.map.defn] doesn't declare a move constructor, which seems to imply that moving from a flat_map should behave -# as if the move constructor were implicitly defined, i.e. it can't restore the invariants -# P3567R0 adds a move constructor that moves the comparator -std/containers/container.adaptors/flat.map/flat.map.cons/move_assign_clears.pass.cpp FAIL -std/containers/container.adaptors/flat.map/flat.map.cons/move_exceptions.pass.cpp FAIL -std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_assign_clears.pass.cpp FAIL -std/containers/container.adaptors/flat.multimap/flat.multimap.cons/move_exceptions.pass.cpp FAIL - # Test bug after LWG-2899 "is_(nothrow_)move_constructible and tuple, optional and unique_ptr" was accepted. std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp FAIL std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp FAIL