Index: test/std/containers/sequences/vector.bool/emplace.pass.cpp =================================================================== --- test/std/containers/sequences/vector.bool/emplace.pass.cpp +++ test/std/containers/sequences/vector.bool/emplace.pass.cpp @@ -34,7 +34,7 @@ assert(c.front() == false); assert(c.back() == true); - i = c.emplace(c.cbegin()+1, 1 == 1); + i = c.emplace(c.cbegin()+1, true); assert(i == c.begin()+1); assert(c.size() == 3); assert(c.front() == false); @@ -56,7 +56,7 @@ assert(c.front() == false); assert(c.back() == true); - i = c.emplace(c.cbegin()+1, 1 == 1); + i = c.emplace(c.cbegin()+1, true); assert(i == c.begin()+1); assert(c.size() == 3); assert(c.size() == 3); Index: test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp =================================================================== --- test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp +++ test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -66,11 +67,15 @@ test_octal("1777777777777777777777"); test_octal< int64_t>("1777777777777777777777"); test_octal("1777777777777777777777"); - if (sizeof(long) == sizeof(int64_t)) { + + const bool long_is_64 = std::integral_constant::value; // avoid compiler warnings + const bool long_long_is_64 = std::integral_constant::value; // avoid compiler warnings + + if (long_is_64) { test_octal< unsigned long>("1777777777777777777777"); test_octal< long>("1777777777777777777777"); } - if (sizeof(long long) == sizeof(int64_t)) { + if (long_long_is_64) { test_octal< unsigned long long>("1777777777777777777777"); test_octal< long long>("1777777777777777777777"); } @@ -81,11 +86,11 @@ test_dec< int32_t>( "-1"); test_dec("18446744073709551615"); test_dec< int64_t>( "-1"); - if (sizeof(long) == sizeof(int64_t)) { + if (long_is_64) { test_dec("18446744073709551615"); test_dec< long>( "-1"); } - if (sizeof(long long) == sizeof(int64_t)) { + if (long_long_is_64) { test_dec("18446744073709551615"); test_dec< long long>( "-1"); } @@ -96,11 +101,11 @@ test_hex< int32_t>( "FFFFFFFF"); test_hex("FFFFFFFFFFFFFFFF"); test_hex< int64_t>("FFFFFFFFFFFFFFFF"); - if (sizeof(long) == sizeof(int64_t)) { + if (long_is_64) { test_hex("FFFFFFFFFFFFFFFF"); test_hex< long>("FFFFFFFFFFFFFFFF"); } - if (sizeof(long long) == sizeof(int64_t)) { + if (long_long_is_64) { test_hex("FFFFFFFFFFFFFFFF"); test_hex< long long>("FFFFFFFFFFFFFFFF"); } Index: test/std/utilities/function.objects/unord.hash/enum.pass.cpp =================================================================== --- test/std/utilities/function.objects/unord.hash/enum.pass.cpp +++ test/std/utilities/function.objects/unord.hash/enum.pass.cpp @@ -43,7 +43,8 @@ for (int i = 0; i <= 5; ++i) { T t(static_cast (i)); - if (sizeof(T) <= sizeof(std::size_t)) + const bool small = std::integral_constant::value; // avoid compiler warnings + if (small) assert(h1(t) == h2(static_cast(i))); } } Index: test/std/utilities/function.objects/unord.hash/integral.pass.cpp =================================================================== --- test/std/utilities/function.objects/unord.hash/integral.pass.cpp +++ test/std/utilities/function.objects/unord.hash/integral.pass.cpp @@ -36,7 +36,8 @@ for (int i = 0; i <= 5; ++i) { T t(static_cast(i)); - if (sizeof(T) <= sizeof(std::size_t)) + const bool small = std::integral_constant::value; // avoid compiler warnings + if (small) { const std::size_t result = h(t); LIBCPP_ASSERT(result == static_cast(t)); Index: test/std/utilities/template.bitset/bitset.members/all.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/all.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/all.pass.cpp @@ -10,6 +10,7 @@ // test bool all() const; #include +#include #include template @@ -20,7 +21,8 @@ assert(v.all() == (N == 0)); v.set(); assert(v.all() == true); - if (N > 1) + const bool greater_than_1 = std::integral_constant 1)>::value; // avoid compiler warnings + if (greater_than_1) { v[N/2] = false; assert(v.all() == false); Index: test/std/utilities/template.bitset/bitset.members/any.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/any.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/any.pass.cpp @@ -10,6 +10,7 @@ // test bool any() const; #include +#include #include template @@ -20,7 +21,8 @@ assert(v.any() == false); v.set(); assert(v.any() == (N != 0)); - if (N > 1) + const bool greater_than_1 = std::integral_constant 1)>::value; // avoid compiler warnings + if (greater_than_1) { v[N/2] = false; assert(v.any() == true); Index: test/std/utilities/template.bitset/bitset.members/index.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/index.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/index.pass.cpp @@ -10,6 +10,7 @@ // test bitset::reference operator[](size_t pos); #include +#include #include #include @@ -31,7 +32,8 @@ void test_index_const() { std::bitset v1 = make_bitset(); - if (N > 0) + const bool greater_than_0 = std::integral_constant 0)>::value; // avoid compiler warnings + if (greater_than_0) { assert(v1[N/2] == v1.test(N/2)); typename std::bitset::reference r = v1[N/2]; Index: test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp @@ -10,6 +10,7 @@ // test constexpr bool operator[](size_t pos) const; #include +#include #include #include @@ -31,7 +32,8 @@ void test_index_const() { const std::bitset v1 = make_bitset(); - if (N > 0) + const bool greater_than_0 = std::integral_constant 0)>::value; // avoid compiler warnings + if (greater_than_0) { assert(v1[N/2] == v1.test(N/2)); } Index: test/std/utilities/template.bitset/bitset.members/none.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/none.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/none.pass.cpp @@ -10,6 +10,7 @@ // test bool none() const; #include +#include #include template @@ -20,7 +21,8 @@ assert(v.none() == true); v.set(); assert(v.none() == (N == 0)); - if (N > 1) + const bool greater_than_1 = std::integral_constant 1)>::value; // avoid compiler warnings + if (greater_than_1) { v[N/2] = false; assert(v.none() == false); Index: test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp @@ -13,6 +13,7 @@ // bool operator!=(const bitset& rhs) const; #include +#include #include #include @@ -36,7 +37,8 @@ const std::bitset v1 = make_bitset(); std::bitset v2 = v1; assert(v1 == v2); - if (N > 0) + const bool greater_than_0 = std::integral_constant 0)>::value; // avoid compiler warnings + if (greater_than_0) { v2[N/2].flip(); assert(v1 != v2); Index: test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -18,8 +19,9 @@ void test_to_ullong() { const std::size_t M = sizeof(unsigned long long) * CHAR_BIT < N ? sizeof(unsigned long long) * CHAR_BIT : N; - const std::size_t X = M == 0 ? sizeof(unsigned long long) * CHAR_BIT - 1 : sizeof(unsigned long long) * CHAR_BIT - M; - const unsigned long long max = M == 0 ? 0 : (unsigned long long)(-1) >> X; + const bool is_M_zero = std::integral_constant::value; // avoid compiler warnings + const std::size_t X = is_M_zero ? sizeof(unsigned long long) * CHAR_BIT - 1 : sizeof(unsigned long long) * CHAR_BIT - M; + const unsigned long long max = is_M_zero ? 0 : (unsigned long long)(-1) >> X; unsigned long long tests[] = {0, std::min(1, max), std::min(2, max), Index: test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp =================================================================== --- test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -19,8 +20,9 @@ void test_to_ulong() { const std::size_t M = sizeof(unsigned long) * CHAR_BIT < N ? sizeof(unsigned long) * CHAR_BIT : N; - const std::size_t X = M == 0 ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M; - const std::size_t max = M == 0 ? 0 : std::size_t(std::numeric_limits::max()) >> X; + const bool is_M_zero = std::integral_constant::value; // avoid compiler warnings + const std::size_t X = is_M_zero ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M; + const std::size_t max = is_M_zero ? 0 : std::size_t(std::numeric_limits::max()) >> X; std::size_t tests[] = {0, std::min(1, max), std::min(2, max),