diff --git a/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp --- a/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ b/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -33,8 +33,9 @@ std::min(max, max-1), max }; - for (unsigned long j : tests) { - std::bitset v(j); + for (std::size_t j_ : tests) { + unsigned long j = static_cast(j_); // avoid compiler warnings + std::bitset v(j); assert(j == v.to_ulong()); }