diff --git a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp --- a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp +++ b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp @@ -87,7 +87,14 @@ check_integral_types(); check_integral_types(); check_integral_types(); - check_integral_types(); + // On some platforms, unsigned int and long are the same size. These + // platforms have a choice of making uint32_t an int or a long. However + // char32_t must promote to an unsigned int on these platforms [conv.prom]. + // Use the following logic to make the test work on such platforms. + // (sizeof(uint32_t) == sizeof(unsigned int)) ? unsigned int : uint32_t; + typedef std::conditional::type char_integral; + check_integral_types(); check_integral_types(); check_integral_types(); check_integral_types();