[libcxx] r228781 - Make convert_to_integral.pass.cpp more platform generic.
Eric Fiselier
eric at efcs.ca
Tue Feb 10 17:18:05 PST 2015
Author: ericwf
Date: Tue Feb 10 19:18:05 2015
New Revision: 228781
URL: http://llvm.org/viewvc/llvm-project?rev=228781&view=rev
Log:
Make convert_to_integral.pass.cpp more platform generic.
Don't depend on the underlying types of enums and wchar_t.
Modified:
libcxx/trunk/test/libcxx/type_traits/convert_to_integral.pass.cpp
Modified: libcxx/trunk/test/libcxx/type_traits/convert_to_integral.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/type_traits/convert_to_integral.pass.cpp?rev=228781&r1=228780&r2=228781&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/type_traits/convert_to_integral.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/type_traits/convert_to_integral.pass.cpp Tue Feb 10 19:18:05 2015
@@ -68,7 +68,7 @@ int main()
check_integral_types<char, int>();
check_integral_types<signed char, int>();
check_integral_types<unsigned char, int>();
- check_integral_types<wchar_t, int>();
+ check_integral_types<wchar_t, decltype(((wchar_t)1) + 1)>();
check_integral_types<char16_t, int>();
check_integral_types<char32_t, uint32_t>();
check_integral_types<short, int>();
@@ -84,6 +84,8 @@ int main()
check_integral_types<__uint128_t, __uint128_t>();
#endif
// TODO(ericwf): Not standard
- check_enum_types<enum1, unsigned>();
- check_enum_types<enum2, unsigned long>();
+ typedef std::underlying_type<enum1>::type Enum1UT;
+ check_enum_types<enum1, decltype(((Enum1UT)1) + 1)>();
+ typedef std::underlying_type<enum2>::type Enum2UT;
+ check_enum_types<enum2, decltype(((Enum2UT)1) + 1)>();
}
More information about the cfe-commits
mailing list