@@ -49,7 +49,7 @@ TEST_CASE("Monadic operations", "[monadic]") {
4949
5050 // test void return
5151 tl::optional<int > o7 = 40 ;
52- auto f7 = [](const int &i ) { return ; };
52+ auto f7 = [](const int & ) { return ; };
5353 auto o7r = o7.map (f7);
5454 STATIC_REQUIRE (
5555 (std::is_same<decltype (o7r), tl::optional<tl::monostate>>::value));
@@ -188,7 +188,7 @@ TEST_CASE("Monadic operations", "[monadic]") {
188188
189189 // test void return
190190 tl::optional<int > o7 = 40 ;
191- auto f7 = [](const int & i ) { return ; };
191+ auto f7 = [](const int &) { return ; };
192192 auto o7r = o7.transform (f7);
193193 STATIC_REQUIRE (
194194 (std::is_same<decltype (o7r), tl::optional<tl::monostate>>::value));
@@ -295,25 +295,25 @@ TEST_CASE("Monadic operations", "[monadic]") {
295295
296296 // lhs is empty
297297 tl::optional<int > o1;
298- auto o1r = o1.and_then ([](int i ) { return tl::optional<float >{42 }; });
298+ auto o1r = o1.and_then ([](int ) { return tl::optional<float >{42 . f }; });
299299 STATIC_REQUIRE ((std::is_same<decltype (o1r), tl::optional<float >>::value));
300300 REQUIRE (!o1r);
301301
302302 // lhs has value
303303 tl::optional<int > o2 = 12 ;
304- auto o2r = o2.and_then ([](int i ) { return tl::optional<float >{42 }; });
304+ auto o2r = o2.and_then ([](int ) { return tl::optional<float >{42 . f }; });
305305 STATIC_REQUIRE ((std::is_same<decltype (o2r), tl::optional<float >>::value));
306306 REQUIRE (o2r.value () == 42 .f );
307307
308308 // lhs is empty, rhs returns empty
309309 tl::optional<int > o3;
310- auto o3r = o3.and_then ([](int i ) { return tl::optional<float >{}; });
310+ auto o3r = o3.and_then ([](int ) { return tl::optional<float >{}; });
311311 STATIC_REQUIRE ((std::is_same<decltype (o3r), tl::optional<float >>::value));
312312 REQUIRE (!o3r);
313313
314314 // rhs returns empty
315315 tl::optional<int > o4 = 12 ;
316- auto o4r = o4.and_then ([](int i ) { return tl::optional<float >{}; });
316+ auto o4r = o4.and_then ([](int ) { return tl::optional<float >{}; });
317317 STATIC_REQUIRE ((std::is_same<decltype (o4r), tl::optional<float >>::value));
318318 REQUIRE (!o4r);
319319
@@ -345,38 +345,38 @@ TEST_CASE("Monadic operations", "[monadic]") {
345345
346346 // test each overload in turn
347347 tl::optional<int > o8 = 42 ;
348- auto o8r = o8.and_then ([](int i ) { return tl::make_optional (42 ); });
348+ auto o8r = o8.and_then ([](int ) { return tl::make_optional (42 ); });
349349 REQUIRE (*o8r == 42 );
350350
351351 tl::optional<int > o9 = 42 ;
352352 auto o9r =
353- std::move (o9).and_then ([](int i ) { return tl::make_optional (42 ); });
353+ std::move (o9).and_then ([](int ) { return tl::make_optional (42 ); });
354354 REQUIRE (*o9r == 42 );
355355
356356 const tl::optional<int > o10 = 42 ;
357- auto o10r = o10.and_then ([](int i ) { return tl::make_optional (42 ); });
357+ auto o10r = o10.and_then ([](int ) { return tl::make_optional (42 ); });
358358 REQUIRE (*o10r == 42 );
359359
360360 const tl::optional<int > o11 = 42 ;
361361 auto o11r =
362- std::move (o11).and_then ([](int i ) { return tl::make_optional (42 ); });
362+ std::move (o11).and_then ([](int ) { return tl::make_optional (42 ); });
363363 REQUIRE (*o11r == 42 );
364364
365365 tl::optional<int > o16 = tl::nullopt ;
366- auto o16r = o16.and_then ([](int i ) { return tl::make_optional (42 ); });
366+ auto o16r = o16.and_then ([](int ) { return tl::make_optional (42 ); });
367367 REQUIRE (!o16r);
368368
369369 tl::optional<int > o17 = tl::nullopt ;
370370 auto o17r =
371- std::move (o17).and_then ([](int i ) { return tl::make_optional (42 ); });
371+ std::move (o17).and_then ([](int ) { return tl::make_optional (42 ); });
372372 REQUIRE (!o17r);
373373
374374 const tl::optional<int > o18 = tl::nullopt ;
375- auto o18r = o18.and_then ([](int i ) { return tl::make_optional (42 ); });
375+ auto o18r = o18.and_then ([](int ) { return tl::make_optional (42 ); });
376376 REQUIRE (!o18r);
377377
378378 const tl::optional<int > o19 = tl::nullopt ;
379- auto o19r = std::move (o19).and_then ([](int i ) { return tl::make_optional (42 ); });
379+ auto o19r = std::move (o19).and_then ([](int ) { return tl::make_optional (42 ); });
380380 REQUIRE (!o19r);
381381
382382 int i = 3 ;
@@ -487,5 +487,6 @@ TEST_CASE("Monadic operations", "[monadic]") {
487487 SECTION (" Issue #2" ) {
488488 tl::optional<foo> f = foo{};
489489 auto x = f.and_then (overloaded{});
490+ (void )x;
490491 }
491- };
492+ }
0 commit comments