Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libcxx/include/limits
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ template<> class numeric_limits<cv long double>;
#else
# include <__config>
# include <__type_traits/is_arithmetic.h>
# include <__type_traits/is_same.h>
# include <__type_traits/is_signed.h>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down Expand Up @@ -220,7 +221,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_modulo = !std::is_signed<_Tp>::value;

# if defined(__i386__) || defined(__x86_64__) || defined(__wasm__)
static _LIBCPP_CONSTEXPR const bool traps = true;
static _LIBCPP_CONSTEXPR const bool traps = is_same<decltype(+_Tp(0)), _Tp>::value;
# else
static _LIBCPP_CONSTEXPR const bool traps = false;
# endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

// traps

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <limits>

#include "test_macros.h"
Expand All @@ -33,17 +35,17 @@ test()
int main(int, char**)
{
test<bool, false>();
test<char, integral_types_trap>();
test<signed char, integral_types_trap>();
test<unsigned char, integral_types_trap>();
test<wchar_t, integral_types_trap>();
test<char, false>();
test<signed char, false>();
test<unsigned char, false>();
test<wchar_t, false>();
#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, integral_types_trap>();
test<char8_t, false>();
#endif
test<char16_t, integral_types_trap>();
test<char32_t, integral_types_trap>();
test<short, integral_types_trap>();
test<unsigned short, integral_types_trap>();
test<char16_t, false>();
test<char32_t, false>();
test<short, false>();
test<unsigned short, false>();
test<int, integral_types_trap>();
test<unsigned int, integral_types_trap>();
test<long, integral_types_trap>();
Expand Down
Loading