forked from microsoft/GSL
Fix clang warning -Winvalid-noreturn on Windows
This commit is contained in:
@@ -113,19 +113,20 @@ namespace details
|
||||
|
||||
#endif
|
||||
|
||||
[[noreturn]] inline void terminate() noexcept
|
||||
{
|
||||
#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)
|
||||
(*gsl::details::get_terminate_handler())();
|
||||
inline void terminate() noexcept { (*gsl::details::get_terminate_handler())(); }
|
||||
#else
|
||||
std::terminate();
|
||||
[[noreturn]] inline void terminate() noexcept { std::terminate(); }
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(GSL_TERMINATE_ON_CONTRACT_VIOLATION)
|
||||
|
||||
template <typename Exception>
|
||||
#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)
|
||||
void throw_exception(Exception&&) noexcept
|
||||
#else
|
||||
[[noreturn]] void throw_exception(Exception&&) noexcept
|
||||
#endif
|
||||
{
|
||||
gsl::details::terminate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user