Skip to content

Commit 9b38fb9

Browse files
Expand workaround for EDG bug in P0323R12_expected (#5249)
Co-authored-by: Casey Carter <[email protected]>
1 parent 2366c08 commit 9b38fb9

File tree

1 file changed

+6
-13
lines changed
  • tests/std/tests/P0323R12_expected

1 file changed

+6
-13
lines changed

tests/std/tests/P0323R12_expected/test.cpp

+6-13
Original file line numberDiff line numberDiff line change
@@ -2476,24 +2476,17 @@ static_assert(test_inherited_constructors());
24762476
template <class T, class E>
24772477
struct ambiguating_expected_copy_constructor_caller {
24782478
struct const_lvalue_taker {
2479-
const_lvalue_taker(const expected<T, E>&) {}
2479+
const_lvalue_taker(const expected<T, E>&);
24802480
};
24812481

2482-
void operator()(expected<T, E>) {}
2483-
void operator()(const_lvalue_taker) {}
2482+
void operator()(expected<T, E>);
2483+
void operator()(const_lvalue_taker);
24842484
};
24852485

24862486
template <class T, class E>
24872487
struct ambiguating_expected_assignment_source {
2488-
operator const expected<T, E>&() && {
2489-
return ex;
2490-
}
2491-
2492-
operator expected<T, E>&&() && {
2493-
return move(ex);
2494-
}
2495-
2496-
expected<T, E> ex;
2488+
operator const expected<T, E>&() &&;
2489+
operator expected<T, E>&&() &&;
24972490
};
24982491

24992492
struct move_only {
@@ -2512,9 +2505,9 @@ static_assert(
25122505
#ifndef __EDG__ // TRANSITION, VSO-1601179
25132506
static_assert(!is_assignable_v<expected<int, char>&, ambiguating_expected_assignment_source<int, char>>);
25142507
static_assert(!is_assignable_v<expected<void, int>&, ambiguating_expected_assignment_source<void, int>>);
2515-
#endif // ^^^ no workaround ^^^
25162508
static_assert(!is_assignable_v<expected<move_only, char>&, ambiguating_expected_assignment_source<move_only, char>>);
25172509
static_assert(!is_assignable_v<expected<void, move_only>&, ambiguating_expected_assignment_source<void, move_only>>);
2510+
#endif // ^^^ no workaround ^^^
25182511

25192512
static_assert(test_lwg_3886());
25202513

0 commit comments

Comments
 (0)