Skip to content

Commit

Permalink
Drop assertion in workaround for std::unreachable. (#908)
Browse files Browse the repository at this point in the history
In environments where `std::unreachable` is not available, we previously
_asserted_ that the code was not reached.  Which I guess was useful in
the early days for exposing any mixups, but doesn't really set the same
expectations as `std::unreachable` itself.

So, drop that assertion.  This also gets rid of a bunch of warnings
from my static checker about "this could be a `static_assert`."
  • Loading branch information
jtv authored Nov 26, 2024
1 parent 6541c61 commit faf5984
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pqxx/util.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ namespace pqxx
// C++23: Retire wrapper.
// PQXX_UNREACHABLE: equivalent to `std::unreachable()` if available.
#if !defined(__cpp_lib_unreachable)
# define PQXX_UNREACHABLE assert(false)
# define PQXX_UNREACHABLE while (false)
#elif !__cpp_lib_unreachable
# define PQXX_UNREACHABLE assert(false)
# define PQXX_UNREACHABLE while (false)
#else
# define PQXX_UNREACHABLE std::unreachable()
#endif
Expand Down

0 comments on commit faf5984

Please sign in to comment.