diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-02-11 01:18:05 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-02-11 01:18:05 +0000 |
commit | 58e985c2db3045f1416520212108f93c8c257b18 (patch) | |
tree | 62b2fba7719a224abac8f83dc079c192a1f0d7ba | |
parent | 1dfbfb8c9e5d67b58bb42c6eae34985d853493e3 (diff) | |
download | bcm5719-llvm-58e985c2db3045f1416520212108f93c8c257b18.tar.gz bcm5719-llvm-58e985c2db3045f1416520212108f93c8c257b18.zip |
Make convert_to_integral.pass.cpp more platform generic.
Don't depend on the underlying types of enums and wchar_t.
llvm-svn: 228781
-rw-r--r-- | libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp index ccdc7675ad6..37060a0521f 100644 --- a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp +++ b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp @@ -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)>(); } |