Index: libcxx/test/std/numerics/c.math/abs.pass.cpp =================================================================== --- libcxx/test/std/numerics/c.math/abs.pass.cpp +++ libcxx/test/std/numerics/c.math/abs.pass.cpp @@ -13,12 +13,6 @@ #include "test_macros.h" -template -struct correct_size_int -{ - typedef typename std::conditional::type type; -}; - template void test_abs() { @@ -39,6 +33,9 @@ assert(std::abs(negative_big_value) == big_value); // make sure it doesnt get casted to a smaller type } +// The following is helpful to keep in mind: +// 1byte == char <= short <= int <= long <= long long + int main(int, char**) { // On some systems char is unsigned. @@ -47,18 +44,20 @@ std::is_signed::value, char, signed char >::type SignedChar; - test_abs::type>(); - test_abs::type>(); - test_abs::type>(); + // All types less than or equal to and not greater than int are promoted to int. + test_abs(); + test_abs(); + test_abs(); - test_abs::type>(); - test_abs::type>(); - test_abs::type>(); + // These three calls have specific overloads: + test_abs(); + test_abs(); + test_abs(); - test_abs::type>(); - test_abs::type>(); - test_abs::type>(); - test_abs::type>(); + test_abs(); + test_abs(); + test_abs(); + test_abs(); test_abs(); test_abs();