[libcxx] r180943 - The push/pop variant of pragma GCC diagnostic is only supported by Clang

Joerg Sonnenberger joerg at bec.de
Thu May 2 12:34:26 PDT 2013


Author: joerg
Date: Thu May  2 14:34:26 2013
New Revision: 180943

URL: http://llvm.org/viewvc/llvm-project?rev=180943&view=rev
Log:
The push/pop variant of pragma GCC diagnostic is only supported by Clang
and GCC 4.6 and newer, so protect accordingly.

Modified:
    libcxx/trunk/src/locale.cpp

Modified: libcxx/trunk/src/locale.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=180943&r1=180942&r2=180943&view=diff
==============================================================================
--- libcxx/trunk/src/locale.cpp (original)
+++ libcxx/trunk/src/locale.cpp Thu May  2 14:34:26 2013
@@ -230,8 +230,10 @@ locale::__imp::__imp(const string& name,
 
 // NOTE avoid the `base class should be explicitly initialized in the
 // copy constructor` warning emitted by GCC
+#if defined(__clang__) || _GNUC_VER >= 406
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wextra"
+#endif
 
 locale::__imp::__imp(const __imp& other)
     : facets_(max<size_t>(N, other.facets_.size())),
@@ -243,7 +245,9 @@ locale::__imp::__imp(const __imp& other)
             facets_[i]->__add_shared();
 }
 
+#if defined(__clang__) || _GNUC_VER >= 406
 #pragma GCC diagnostic pop
+#endif
 
 locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
     : facets_(N),





More information about the cfe-commits mailing list