summaryrefslogtreecommitdiff
path: root/test/std/utilities/template.bitset/bitset.members/all.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/template.bitset/bitset.members/all.pass.cpp')
-rw-r--r--test/std/utilities/template.bitset/bitset.members/all.pass.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/std/utilities/template.bitset/bitset.members/all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/all.pass.cpp
index 5387b733918fe..de1cddb5b1ae8 100644
--- a/test/std/utilities/template.bitset/bitset.members/all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/all.pass.cpp
@@ -10,6 +10,7 @@
// test bool all() const;
#include <bitset>
+#include <type_traits>
#include <cassert>
template <std::size_t N>
@@ -20,7 +21,8 @@ void test_all()
assert(v.all() == (N == 0));
v.set();
assert(v.all() == true);
- if (N > 1)
+ const bool greater_than_1 = std::integral_constant<bool, (N > 1)>::value; // avoid compiler warnings
+ if (greater_than_1)
{
v[N/2] = false;
assert(v.all() == false);