From e61279b0a8b254af3257feb187cc77fde1d5d601 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 21 Jan 2025 13:17:30 -0800 Subject: [PATCH] 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. Drive-by: Don't bother to implement some member functions that aren't ODR-used. --- tests/std/tests/P0323R12_expected/test.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/std/tests/P0323R12_expected/test.cpp b/tests/std/tests/P0323R12_expected/test.cpp index 81335d3a8b3..37476de98b0 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 { @@ -2512,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());