Skip to content

Fix some Clang warnings#73

Merged
martinmoene merged 2 commits intononstd-lite:masterfrom
Quuxplusone:fix-warnings
Dec 9, 2024
Merged

Fix some Clang warnings#73
martinmoene merged 2 commits intononstd-lite:masterfrom
Quuxplusone:fix-warnings

Conversation

@Quuxplusone
Copy link
Contributor

A plain cmake .. ; make on OSX with the stock Clang gives some warnings that look easy to fix; so, I fixed them.

The second commit, re decltype( get_unexpected().value() ), merits a close look, because the old code seems so weird (your code using a method that you yourself deprecated). There might be something sneaky going on there.

    warning: unused variable 'nullopt' [-Wunused-const-variable]
     2284 | const nullopt_t nullopt{};
          |                 ^~~~~~~

    warning: unused variable 'u' [-Wunused-variable]
      610 |     nonstd::unexpected<int> u{7};
          |                             ^
Clang complains:

    warning: 'value' is deprecated: replace value() with error() [-Wdeprecated-declarations]
     2333 |         using ContainedEx = typename std::remove_reference< decltype( get_unexpected().value() ) >::type;
          |                                                                                        ^
@martinmoene martinmoene merged commit 5cea391 into nonstd-lite:master Dec 9, 2024
@martinmoene
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants