We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aec1cce commit 65d3a83Copy full SHA for 65d3a83
libcxx/test/libcxx/utilities/expected/expected.void/or_else.mandates.verify.cpp
@@ -119,12 +119,13 @@ void test() {
119
}
120
121
122
-
123
// Test nodiscard
124
{
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}}
+ std::expected<void, int> e(std::unexpected<int>(1));
+
+ // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ e.or_else([](const int&) -> std::expected<void, int> { return std::unexpected(1); });
128
129
130
131
// clang-format on
0 commit comments