Revert addition of std::unreachable

After further testing with the fuzzer corpus, std::unreachable isn't
necessary here. It's fine to just let the default case break to fix
the Coverity warning.
This commit is contained in:
Tim Wojtulewicz 2025-04-09 08:39:47 -07:00
parent f3568d148f
commit 58fb91315e
2 changed files with 2 additions and 17 deletions

View file

@ -661,20 +661,5 @@ inline std::vector<std::wstring_view> split(const wchar_t* s, const wchar_t* del
return split(std::wstring_view(s), std::wstring_view(delim));
}
/**
* Implementation of std::unreachable. Once C++23 is supported this can be replaced with
* an alias. This implementation is taken from cppreference.
*/
[[noreturn]] inline void unreachable() {
// Uses compiler specific extensions if possible. Even if no extension is used,
// undefined behavior is still raised by an empty function body and the noreturn
// attribute.
#if defined(_MSC_VER) && ! defined(__clang__) // MSVC
__assume(false);
#else // GCC, Clang
__builtin_unreachable();
#endif
}
} // namespace util
} // namespace zeek