summaryrefslogtreecommitdiff
path: root/test/std/utilities/template.bitset
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/template.bitset')
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp18
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/default.pass.cpp17
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp86
-rw-r--r--test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp22
-rw-r--r--test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp8
-rw-r--r--test/std/utilities/template.bitset/bitset.members/count.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/index.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp3
-rw-r--r--test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/test.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp2
-rw-r--r--test/std/utilities/template.bitset/version.pass.cpp20
28 files changed, 117 insertions, 99 deletions
diff --git a/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
index 9411435e29e87..ab623bb01f789 100644
--- a/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// template <class charT>
// explicit bitset(const charT* str,
// typename basic_string<charT>::size_type n = basic_string<charT>::npos,
@@ -18,20 +17,19 @@
#include <algorithm> // for 'min' and 'max'
#include <stdexcept> // for 'invalid_argument'
-#pragma clang diagnostic ignored "-Wtautological-compare"
+#include "test_macros.h"
template <std::size_t N>
void test_char_pointer_ctor()
{
{
- try
- {
- std::bitset<N> v("xxx1010101010xxxx");
- assert(false);
- }
- catch (std::invalid_argument&)
- {
- }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+ try {
+ std::bitset<N> v("xxx1010101010xxxx");
+ assert(false);
+ }
+ catch (std::invalid_argument&) {}
+#endif
}
{
diff --git a/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
index bd5ca7e08b2ab..f4f8d390de08f 100644
--- a/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
@@ -12,19 +12,26 @@
#include <bitset>
#include <cassert>
-#pragma clang diagnostic ignored "-Wtautological-compare"
+#include "test_macros.h"
template <std::size_t N>
void test_default_ctor()
{
{
- _LIBCPP_CONSTEXPR std::bitset<N> v1;
- assert(v1.size() == N);
- for (std::size_t i = 0; i < N; ++i)
- assert(v1[i] == false);
+ TEST_CONSTEXPR std::bitset<N> v1;
+ assert(v1.size() == N);
+ for (std::size_t i = 0; i < N; ++i)
+ assert(v1[i] == false);
}
+#if TEST_STD_VER >= 11
+ {
+ constexpr std::bitset<N> v1;
+ static_assert(v1.size() == N, "");
+ }
+#endif
}
+
int main()
{
test_default_ctor<0>();
diff --git a/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
index b08720f57ee36..0e4793027c989 100644
--- a/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// test bitset(string, pos, n, zero, one);
#include <bitset>
@@ -15,65 +14,60 @@
#include <algorithm> // for 'min' and 'max'
#include <stdexcept> // for 'invalid_argument'
-#pragma clang diagnostic ignored "-Wtautological-compare"
+#include "test_macros.h"
template <std::size_t N>
void test_string_ctor()
{
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
- try
- {
- std::string str("xxx1010101010xxxx");
- std::bitset<N> v(str, str.size()+1, 10);
- assert(false);
- }
- catch (std::out_of_range&)
- {
- }
+ try {
+ std::string str("xxx1010101010xxxx");
+ std::bitset<N> v(str, str.size()+1, 10);
+ assert(false);
+ }
+ catch (std::out_of_range&)
+ {
+ }
}
-
- {
- try
{
- std::string str("xxx1010101010xxxx");
- std::bitset<N> v(str, 2, 10);
- assert(false);
+ try {
+ std::string str("xxx1010101010xxxx");
+ std::bitset<N> v(str, 2, 10);
+ assert(false);
+ }
+ catch (std::invalid_argument&)
+ {
+ }
}
- catch (std::invalid_argument&)
{
+ try {
+ std::string str("xxxbababababaxxxx");
+ std::bitset<N> v(str, 2, 10, 'a', 'b');
+ assert(false);
+ }
+ catch (std::invalid_argument&)
+ {
+ }
}
- }
-
+#endif // TEST_HAS_NO_EXCEPTIONS
{
- std::string str("xxx1010101010xxxx");
- std::bitset<N> v(str, 3, 10);
- std::size_t M = std::min<std::size_t>(N, 10);
- for (std::size_t i = 0; i < M; ++i)
- assert(v[i] == (str[3 + M - 1 - i] == '1'));
- for (std::size_t i = 10; i < N; ++i)
- assert(v[i] == false);
+ std::string str("xxx1010101010xxxx");
+ std::bitset<N> v(str, 3, 10);
+ std::size_t M = std::min<std::size_t>(N, 10);
+ for (std::size_t i = 0; i < M; ++i)
+ assert(v[i] == (str[3 + M - 1 - i] == '1'));
+ for (std::size_t i = 10; i < N; ++i)
+ assert(v[i] == false);
}
-
- {
- try
{
std::string str("xxxbababababaxxxx");
- std::bitset<N> v(str, 2, 10, 'a', 'b');
- assert(false);
- }
- catch (std::invalid_argument&)
- {
- }
- }
-
- {
- std::string str("xxxbababababaxxxx");
- std::bitset<N> v(str, 3, 10, 'a', 'b');
- std::size_t M = std::min<std::size_t>(N, 10);
- for (std::size_t i = 0; i < M; ++i)
- assert(v[i] == (str[3 + M - 1 - i] == 'b'));
- for (std::size_t i = 10; i < N; ++i)
- assert(v[i] == false);
+ std::bitset<N> v(str, 3, 10, 'a', 'b');
+ std::size_t M = std::min<std::size_t>(N, 10);
+ for (std::size_t i = 0; i < M; ++i)
+ assert(v[i] == (str[3 + M - 1 - i] == 'b'));
+ for (std::size_t i = 10; i < N; ++i)
+ assert(v[i] == false);
}
}
diff --git a/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
index f232447e08c3a..1b121c5fb9280 100644
--- a/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
@@ -13,20 +13,26 @@
#include <cassert>
#include <algorithm> // for 'min' and 'max'
-#pragma clang diagnostic ignored "-Wtautological-compare"
+#include "test_macros.h"
template <std::size_t N>
void test_val_ctor()
{
{
- _LIBCPP_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
- assert(v.size() == N);
- unsigned M = std::min<std::size_t>(N, 64);
- for (std::size_t i = 0; i < M; ++i)
- assert(v[i] == (i & 1));
- for (std::size_t i = M; i < N; ++i)
- assert(v[i] == false);
+ TEST_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
+ assert(v.size() == N);
+ unsigned M = std::min<std::size_t>(N, 64);
+ for (std::size_t i = 0; i < M; ++i)
+ assert(v[i] == (i & 1));
+ for (std::size_t i = M; i < N; ++i)
+ assert(v[i] == false);
}
+#if TEST_STD_VER >= 11
+ {
+ constexpr std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
+ static_assert(v.size() == N, "");
+ }
+#endif
}
int main()
diff --git a/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp b/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
index 520f2e8757c27..bc65078911b2c 100644
--- a/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
@@ -16,12 +16,12 @@
// size_t operator()(T val) const;
// };
-// Not very portable
-
#include <bitset>
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
template <std::size_t N>
void
test()
@@ -32,7 +32,9 @@ test()
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
H h;
T bs(static_cast<unsigned long long>(N));
- assert(h(bs) == N);
+ const std::size_t result = h(bs);
+ LIBCPP_ASSERT(result == N);
+ ((void)result); // Prevent unused warning
}
int main()
diff --git a/test/std/utilities/template.bitset/bitset.members/count.pass.cpp b/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
index fb9ce6422997a..c8a14c9b60496 100644
--- a/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
index 6c4f5c699850e..a25e5bd9da220 100644
--- a/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
index cffca68fb1ea6..88ce8e943caf1 100644
--- a/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
@@ -14,8 +14,6 @@
#include <cstdlib>
#include <cassert>
-#pragma clang diagnostic ignored "-Wtautological-compare"
-
template <std::size_t N>
std::bitset<N>
make_bitset()
diff --git a/test/std/utilities/template.bitset/bitset.members/index.pass.cpp b/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
index b96aaa51ab8fc..02e58a7890c54 100644
--- a/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp b/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
index e3c28c6935767..870a504c2d751 100644
--- a/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp b/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
index 7fe9fa72e9243..57b77d2570d54 100644
--- a/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
index bed3e28ece818..3adab77b4131f 100644
--- a/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
index 2f8f7111f5a13..d9fbb3e11dad8 100644
--- a/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
index b599ec398b309..64ca15fda137d 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
index 5f6cf3d0a30c1..24761c628c03e 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
@@ -16,7 +16,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
index 6e63879890a64..f2880f67ab6e6 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
index e68a641cadc66..420996759d0d7 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
index ee44d92c43b8e..eed25e27448df 100644
--- a/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
@@ -12,7 +12,9 @@
#include <bitset>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
void test_reset_all()
diff --git a/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
index 6de256b00cc55..f01d35b9a33c3 100644
--- a/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
@@ -13,9 +13,6 @@
#include <bitset>
#include <cassert>
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wtautological-compare"
-
template <std::size_t N>
void test_reset_one()
{
diff --git a/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp b/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
index 87fcc281fa26e..180fa84f4488b 100644
--- a/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
index 1dd89c1844b94..47494fc459a50 100644
--- a/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
index 56454a84f1135..e5c3e25352cc4 100644
--- a/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
@@ -12,7 +12,9 @@
#include <bitset>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
void test_set_all()
diff --git a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
index ce594d0ae891b..161afd11c291d 100644
--- a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
@@ -14,8 +14,6 @@
#include <cstdlib>
#include <cassert>
-#pragma clang diagnostic ignored "-Wtautological-compare"
-
template <std::size_t N>
std::bitset<N>
make_bitset()
diff --git a/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp b/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
index b65794097470f..5b2958cca5239 100644
--- a/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
@@ -26,7 +26,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
index 751cee69102a3..80792d919ccfd 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
index fda5e5cda8eea..65a7004acb86d 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
index 067f868215be9..dcabaa4a9a4d4 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
@@ -13,7 +13,9 @@
#include <cstdlib>
#include <cassert>
+#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
template <std::size_t N>
std::bitset<N>
diff --git a/test/std/utilities/template.bitset/version.pass.cpp b/test/std/utilities/template.bitset/version.pass.cpp
deleted file mode 100644
index 5ae984c0092df..0000000000000
--- a/test/std/utilities/template.bitset/version.pass.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <bitset>
-
-#include <bitset>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main()
-{
-}