]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Suppress clang -Wc99-extensions warnings in <complex>
authorJonathan Wakely <jwakely@redhat.com>
Tue, 8 Aug 2023 21:19:49 +0000 (22:19 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 9 Aug 2023 14:19:16 +0000 (15:19 +0100)
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

index 0ba2167bf0222923ffe7cad0c83763955992c7cb..a4abe9aa96a9bd93ea97ec3d51974538a3d71d7a 100644 (file)
 // 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 */