summaryrefslogtreecommitdiff
path: root/test/std/utilities/template.bitset/bitset.members/all.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
commit0dc0969cd0a732760f0aa79942a04e0eaef297c4 (patch)
tree051bdb57b1ac6ee143f61ddbb47bd0da619f6f0c /test/std/utilities/template.bitset/bitset.members/all.pass.cpp
parent868847c6900e575417c03bced6e562b3af891318 (diff)
Notes
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);