[libcxx] r198100 - Merging r197314:

Bill Wendling isanbard at gmail.com
Fri Dec 27 23:40:58 PST 2013


Author: void
Date: Sat Dec 28 01:40:58 2013
New Revision: 198100

URL: http://llvm.org/viewvc/llvm-project?rev=198100&view=rev
Log:
Merging r197314:
------------------------------------------------------------------------
r197314 | logan | 2013-12-13 22:45:09 -0800 (Fri, 13 Dec 2013) | 9 lines

Fix GCC unknown pragma warning in libc++.

We should check defined(__clang__) before the usage of the
clang diagnostic pragmas.

The [-Wswitch] warning in src/future.cpp should be ignored.
As the result, the equivalent GCC pragma is added.


------------------------------------------------------------------------

Modified:
    libcxx/branches/release_34/   (props changed)
    libcxx/branches/release_34/src/future.cpp
    libcxx/branches/release_34/src/regex.cpp

Propchange: libcxx/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 28 01:40:58 2013
@@ -1,2 +1,2 @@
 /libcxx/branches/apple:136569-137939
-/libcxx/trunk:195136,195143,195693,196058,197061
+/libcxx/trunk:195136,195143,195693,196058,197061,197314

Modified: libcxx/branches/release_34/src/future.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_34/src/future.cpp?rev=198100&r1=198099&r2=198100&view=diff
==============================================================================
--- libcxx/branches/release_34/src/future.cpp (original)
+++ libcxx/branches/release_34/src/future.cpp Sat Dec 28 01:40:58 2013
@@ -26,8 +26,13 @@ __future_error_category::name() const _N
     return "future";
 }
 
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wswitch"
+#elif defined(__GNUC__) || defined(__GNUG__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch"
+#endif
 
 string
 __future_error_category::message(int ev) const
@@ -50,7 +55,11 @@ __future_error_category::message(int ev)
     return string("unspecified future_errc value\n");
 }
 
+#if defined(__clang__)
 #pragma clang diagnostic pop
+#elif defined(__GNUC__) || defined(__GNUG__)
+#pragma GCC diagnostic pop
+#endif
 
 const error_category&
 future_category() _NOEXCEPT

Modified: libcxx/branches/release_34/src/regex.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_34/src/regex.cpp?rev=198100&r1=198099&r2=198100&view=diff
==============================================================================
--- libcxx/branches/release_34/src/regex.cpp (original)
+++ libcxx/branches/release_34/src/regex.cpp Sat Dec 28 01:40:58 2013
@@ -69,8 +69,10 @@ regex_error::~regex_error() throw() {}
 
 namespace {
 
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wpadded"
+#endif
 
 struct collationnames
 {
@@ -78,7 +80,9 @@ struct collationnames
     char char_;
 };
 
+#if defined(__clang__)
 #pragma clang diagnostic pop
+#endif
 
 const collationnames collatenames[] =
 {
@@ -195,8 +199,10 @@ const collationnames collatenames[] =
     {"zero", 0x30}
 };
 
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wpadded"
+#endif
 
 struct classnames
 {
@@ -204,7 +210,9 @@ struct classnames
     ctype_base::mask mask_;
 };
 
+#if defined(__clang__)
 #pragma clang diagnostic pop
+#endif
 
 const classnames ClassNames[] =
 {





More information about the cfe-commits mailing list