mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Fix clang warning -Wmissing-noreturn
This commit is contained in:
parent
6fe1a42035
commit
1b15a73942
@ -14,21 +14,17 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cstdlib> // for std::exit
|
||||
#include <gsl/span> // for span
|
||||
#include <cstdlib> // for std::exit
|
||||
#include <gsl/span> // for span
|
||||
|
||||
int operator_subscript_no_throw() noexcept
|
||||
{
|
||||
int arr[10];
|
||||
const gsl::span<int> sp { arr };
|
||||
int arr[10];
|
||||
const gsl::span<int> sp{arr};
|
||||
return sp[11];
|
||||
}
|
||||
|
||||
|
||||
void test_terminate()
|
||||
{
|
||||
std::exit(0);
|
||||
}
|
||||
[[noreturn]] void test_terminate() { std::exit(0); }
|
||||
|
||||
void setup_termination_handler() noexcept
|
||||
{
|
||||
@ -44,7 +40,6 @@ void setup_termination_handler() noexcept
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int main() noexcept
|
||||
{
|
||||
setup_termination_handler();
|
||||
|
@ -14,20 +14,17 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cstdlib> // for std::exit
|
||||
#include <gsl/gsl_util> // for narrow
|
||||
#include <cstdlib> // for std::exit
|
||||
#include <gsl/gsl_assert> // for get_terminate
|
||||
#include <gsl/gsl_util> // for narrow
|
||||
|
||||
int narrow_no_throw()
|
||||
{
|
||||
const long long bigNumber = 0x0fffffffffffffff;
|
||||
return gsl::narrow<int>(bigNumber);
|
||||
return gsl::narrow<int>(bigNumber);
|
||||
}
|
||||
|
||||
void test_terminate()
|
||||
{
|
||||
std::exit(0);
|
||||
}
|
||||
[[noreturn]] void test_terminate() { std::exit(0); }
|
||||
|
||||
void setup_termination_handler() noexcept
|
||||
{
|
||||
@ -43,7 +40,6 @@ void setup_termination_handler() noexcept
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
setup_termination_handler();
|
||||
|
Loading…
Reference in New Issue
Block a user