[committed] libstdc++: Suppress clang -Wc99-extensions warnings in <complex>

Message ID 20230809142245.1015025-1-jwakely@redhat.com
State Accepted
Headers
Series [committed] libstdc++: Suppress clang -Wc99-extensions warnings in <complex> |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Jonathan Wakely Aug. 9, 2023, 2:22 p.m. UTC
  Tested x86_64-linux. Pushed to trunk.

-- >8 --

This prevents Clang from warning about the use of the non-standard
__complex__ keyword.

libstdc++-v3/ChangeLog:

	* include/std/complex: Add diagnostic pragma for clang.
---
 libstdc++-v3/include/std/complex | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 0ba2167bf02..a4abe9aa96a 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -47,6 +47,11 @@ 
 // Get rid of a macro possibly defined in <complex.h>
 #undef complex
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc99-extensions"
+#endif
+
 #if __cplusplus > 201703L
 # define __cpp_lib_constexpr_complex 201711L
 #endif
@@ -2642,4 +2647,8 @@  _GLIBCXX_END_NAMESPACE_VERSION
 
 #endif  // C++11
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 #endif  /* _GLIBCXX_COMPLEX */