From be39f9a6c3382640d7065c383d8a2ebaadb26fa3 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Sun, 8 Dec 2024 11:43:42 -0500 Subject: [PATCH] Silence Clang warnings about unused variables. NFC. warning: unused variable 'nullopt' [-Wunused-const-variable] 2284 | const nullopt_t nullopt{}; | ^~~~~~~ warning: unused variable 'u' [-Wunused-variable] 610 | nonstd::unexpected u{7}; | ^ --- test/expected.t.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/expected.t.cpp b/test/expected.t.cpp index abc817b..ac979d0 100644 --- a/test/expected.t.cpp +++ b/test/expected.t.cpp @@ -607,7 +607,7 @@ CASE( "make_unexpected_from_current_exception(): Allows to create an unexpected_ CASE( "unexpected: C++17 and later provide unexpected_type as unexpected" ) { #if nsel_CPP17_OR_GREATER || nsel_COMPILER_MSVC_VERSION > 141 - nonstd::unexpected u{7}; + [[maybe_unused]] nonstd::unexpected u{7}; #else EXPECT( !!"unexpected is not available (no C++17)." ); #endif @@ -2281,7 +2281,7 @@ CASE( "invoke" ) struct nullopt_t{}; -const nullopt_t nullopt{}; +[[maybe_unused]] const nullopt_t nullopt{}; /// optional expressed in expected