Skip to content

Commit 65d3a83

Browse files
committed
trying to fix failing tests
1 parent aec1cce commit 65d3a83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libcxx/test/libcxx/utilities/expected/expected.void/or_else.mandates.verify.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,13 @@ void test() {
119119
}
120120
}
121121

122-
123122
// Test nodiscard
124123
{
125-
const std::expected<int, int> f1(std::unexpected<int>(1));
126-
127-
f1.or_else([](int&){ return 1; }); // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
124+
std::expected<void, int> e(std::unexpected<int>(1));
125+
126+
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
127+
e.or_else([](const int&) -> std::expected<void, int> { return std::unexpected(1); });
128+
128129
}
129130
}
130131
// clang-format on

0 commit comments

Comments
 (0)