Skip to content

Commit 3f1c9cc

Browse files
committed
Silence Visual C++ warning 'discarded return value' (#74)
expected.t.cpp(1347): warning C4834: discarding return value of function with 'nodiscard' attribute
1 parent d426ef2 commit 3f1c9cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/expected.t.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ CASE( "expected: Allows to map unexpected with or_else" " [monadic p2505r3]" )
13441344
}
13451345

13461346
const auto fallback_throw = []( int ) -> expected<int, int> { throw std::runtime_error( "or_else" ); };
1347-
EXPECT_THROWS_AS( (expected<int, int>{ unexpect, 42 }).or_else( fallback_throw ), std::runtime_error );
1347+
EXPECT_THROWS_AS( (void)(expected<int, int>{ unexpect, 42 }).or_else( fallback_throw ), std::runtime_error );
13481348

13491349
const auto moveonly_fallback_to_66 = [](int) -> expected<MoveOnly, int> { return MoveOnly{ 66 }; };
13501350
EXPECT( (expected<MoveOnly, int>{ MoveOnly{ 33 } }).or_else( moveonly_fallback_to_66 ).value() == 33 );

0 commit comments

Comments
 (0)