Guard Clang and GCC specific pragmas. Patch from STL@microsoft.com

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267836 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/test/std/depr/depr.c.headers/stdio_h.pass.cpp
index 3c5dd0e..0ea105d 100644
--- a/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/stdio_h.pass.cpp
@@ -99,8 +99,10 @@
 
 #include <cstdarg>
 
+#if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wformat-zero-length"
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" // for tmpnam
+#endif
 
 int main()
 {
diff --git a/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/test/std/depr/depr.c.headers/wchar_h.pass.cpp
index 97671d4..6bd2b2d 100644
--- a/test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ b/test/std/depr/depr.c.headers/wchar_h.pass.cpp
@@ -34,10 +34,14 @@
 //    a complete object type other than an array type that can hold the conversion 
 //    state information necessary to convert between sequences of multibyte 
 //    characters and wide characters
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wmissing-braces"
+#endif
     mbstate_t mb = {0};
+#if defined(__clang__)
 #pragma clang diagnostic pop
+#endif
 
     size_t s = 0;
     tm *tm = 0;
diff --git a/test/std/input.output/file.streams/c.files/cstdio.pass.cpp b/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
index a06f044..56beb58 100644
--- a/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ b/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -78,9 +78,11 @@
 
 #include <cstdarg>
 
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wformat-zero-length"
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
 
 int main()
 {
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 9411435..1743405 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
@@ -18,7 +18,9 @@
 #include <algorithm> // for 'min' and 'max'
 #include <stdexcept> // for 'invalid_argument'
 
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
 
 template <std::size_t N>
 void test_char_pointer_ctor()
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 bd5ca7e..2162f34 100644
--- a/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/default.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_default_ctor()
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 b08720f..a040a37 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
@@ -15,7 +15,9 @@
 #include <algorithm> // for 'min' and 'max'
 #include <stdexcept> // for 'invalid_argument'
 
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
 
 template <std::size_t N>
 void test_string_ctor()
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 f232447..4ba312b 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,7 +13,9 @@
 #include <cassert>
 #include <algorithm> // for 'min' and 'max'
 
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
 
 template <std::size_t N>
 void test_val_ctor()
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 fb9ce64..c8a14c9 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 6c4f5c6..a25e5bd 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 cffca68..453c82b 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,7 +14,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.pass.cpp b/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
index b96aaa5..02e58a7 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 e3c28c6..870a504 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 7fe9fa7..57b77d2 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 bed3e28..3adab77 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 2f8f711..d9fbb3e 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 b599ec3..64ca15f 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 5f6cf3d..24761c6 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 6e63879..f2880f6 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 e68a641..4209967 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 ee44d92..eed25e2 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 6de256b..5e67739 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,8 +13,10 @@
 #include <bitset>
 #include <cassert>
 
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
 
 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 87fcc28..180fa84 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 1dd89c1..47494fc 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 56454a8..e5c3e25 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 ce594d0..1566106 100644
--- a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
@@ -14,7 +14,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/to_string.pass.cpp b/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
index b657940..5b2958c 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 751cee6..80792d9 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 fda5e5c..65a7004 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 067f868..dcabaa4 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/support/disable_missing_braces_warning.h b/test/support/disable_missing_braces_warning.h
index 97fd8a8..c53eef8 100644
--- a/test/support/disable_missing_braces_warning.h
+++ b/test/support/disable_missing_braces_warning.h
@@ -11,6 +11,8 @@
 
 // std::array is explicitly allowed to be initialized with A a = { init-list };.
 // Disable the missing braces warning for this reason.
+#if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wmissing-braces"
+#endif
 
 #endif // SUPPORT_DISABLE_MISSING_BRACES_WARNING_H