From c8c4b239814640f9572e2865f6cd1575df85d41b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 24 Jan 2025 02:11:17 -0800 Subject: [PATCH 1/2] Drive-by: Don't bother to implement some member functions that aren't ODR-used. Co-authored-by: Casey Carter --- tests/std/tests/P0323R12_expected/test.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/std/tests/P0323R12_expected/test.cpp b/tests/std/tests/P0323R12_expected/test.cpp index 81335d3a8b3..c43c9978efa 100644 --- a/tests/std/tests/P0323R12_expected/test.cpp +++ b/tests/std/tests/P0323R12_expected/test.cpp @@ -2476,24 +2476,17 @@ static_assert(test_inherited_constructors()); template struct ambiguating_expected_copy_constructor_caller { struct const_lvalue_taker { - const_lvalue_taker(const expected&) {} + const_lvalue_taker(const expected&); }; - void operator()(expected) {} - void operator()(const_lvalue_taker) {} + void operator()(expected); + void operator()(const_lvalue_taker); }; template struct ambiguating_expected_assignment_source { - operator const expected&() && { - return ex; - } - - operator expected&&() && { - return move(ex); - } - - expected ex; + operator const expected&() &&; + operator expected&&() &&; }; struct move_only { From f401839184f001ff3d604a5cb8d624c43b09263f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 24 Jan 2025 02:12:03 -0800 Subject: [PATCH 2/2] Expand workaround for EDG bug in `P0323R12_expected` The IntelliSense compiler just disabled compatibility with an outdated MSVC overload resolution bug, causing an apparent regression in `P0323R12_expected`. These `static_assert`s that were previously passing - but for the wrong reason - now fail with VS trunk. It looks a lot like VSO-1601179, so let's just expand the existing conditional to cover the new failures. Co-authored-by: Casey Carter --- tests/std/tests/P0323R12_expected/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/P0323R12_expected/test.cpp b/tests/std/tests/P0323R12_expected/test.cpp index c43c9978efa..37476de98b0 100644 --- a/tests/std/tests/P0323R12_expected/test.cpp +++ b/tests/std/tests/P0323R12_expected/test.cpp @@ -2505,9 +2505,9 @@ static_assert( #ifndef __EDG__ // TRANSITION, VSO-1601179 static_assert(!is_assignable_v&, ambiguating_expected_assignment_source>); static_assert(!is_assignable_v&, ambiguating_expected_assignment_source>); -#endif // ^^^ no workaround ^^^ static_assert(!is_assignable_v&, ambiguating_expected_assignment_source>); static_assert(!is_assignable_v&, ambiguating_expected_assignment_source>); +#endif // ^^^ no workaround ^^^ static_assert(test_lwg_3886());