diff --git a/src/catch2/internal/catch_unreachable.hpp b/src/catch2/internal/catch_unreachable.hpp index 02cca494..fc3f75b5 100644 --- a/src/catch2/internal/catch_unreachable.hpp +++ b/src/catch2/internal/catch_unreachable.hpp @@ -39,9 +39,13 @@ namespace Catch { __assume( false ); # elif defined( __GNUC__ ) __builtin_unreachable(); -# endif -# endif // ^^ NDEBUG +# else // vv platform without known optimization hint std::terminate(); +# endif +# else // ^^ NDEBUG + // For non-release builds, we prefer termination on bug over UB + std::terminate(); +# endif // } } // namespace Detail