Skip to content

Commit

Permalink
Silence Clang warnings about unused variables. NFC.
Browse files Browse the repository at this point in the history
    warning: unused variable 'nullopt' [-Wunused-const-variable]
     2284 | const nullopt_t nullopt{};
          |                 ^~~~~~~

    warning: unused variable 'u' [-Wunused-variable]
      610 |     nonstd::unexpected<int> u{7};
          |                             ^
  • Loading branch information
Quuxplusone authored and martinmoene committed Dec 9, 2024
1 parent 48e5e22 commit be39f9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/expected.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> u{7};
[[maybe_unused]] nonstd::unexpected<int> u{7};
#else
EXPECT( !!"unexpected is not available (no C++17)." );
#endif
Expand Down Expand Up @@ -2281,7 +2281,7 @@ CASE( "invoke" )

struct nullopt_t{};

const nullopt_t nullopt{};
[[maybe_unused]] const nullopt_t nullopt{};

/// optional expressed in expected

Expand Down

0 comments on commit be39f9a

Please sign in to comment.