STL_MSFT created this revision.
STL_MSFT added reviewers: mclow.lists, EricWF.
STL_MSFT added a subscriber: cfe-commits.

[libc++] Consistently guard "#pragma clang" with "#if defined(__clang__)".

Similarly, consistently guard "#pragma GCC" with "#if defined(__GNUC__)".

Fixes MSVC "warning C4068: unknown pragma".

http://reviews.llvm.org/D19618

Files:
  test/std/depr/depr.c.headers/stdio_h.pass.cpp
  test/std/depr/depr.c.headers/wchar_h.pass.cpp
  test/std/input.output/file.streams/c.files/cstdio.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
  test/std/utilities/template.bitset/bitset.members/count.pass.cpp
  test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
  test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
  test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
  test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
  test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/test.pass.cpp
  test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
  test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
  test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
  test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
  test/support/disable_missing_braces_warning.h

Index: test/support/disable_missing_braces_warning.h
===================================================================
--- test/support/disable_missing_braces_warning.h
+++ 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
Index: test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/test.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/test.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
+++ 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()
Index: test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
+++ 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()
Index: test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
+++ 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()
Index: test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/index.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/index.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.members/count.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.members/count.pass.cpp
+++ 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>
Index: test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
+++ 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()
Index: test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
+++ 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()
Index: test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
+++ 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()
Index: test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
===================================================================
--- test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
+++ 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()
Index: test/std/input.output/file.streams/c.files/cstdio.pass.cpp
===================================================================
--- test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ 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()
 {
Index: test/std/depr/depr.c.headers/wchar_h.pass.cpp
===================================================================
--- test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ 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;
Index: test/std/depr/depr.c.headers/stdio_h.pass.cpp
===================================================================
--- test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ 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()
 {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to