[libcxx-commits] [libcxx] [libc++] Fix disabling of extension warnings in C++20 and later (PR #134989)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 7 22:31:00 PDT 2025
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/134989
>From a0bbdd63c05e0f25998f71b9a0d4a4bfaa9fc52b Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 9 Apr 2025 12:40:18 +0200
Subject: [PATCH] [libc++] Fix disabling of extension warnings in C++20 and
later
---
libcxx/include/__config | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libcxx/include/__config b/libcxx/include/__config
index e14632f65b877..110450f6e9c51 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -538,9 +538,9 @@ typedef __char32_t char32_t;
# endif
// Clang modules take a significant compile time hit when pushing and popping diagnostics.
-// Since all the headers are marked as system headers in the modulemap, we can simply disable this
-// pushing and popping when building with clang modules.
-# if !__has_feature(modules)
+// Since all the headers are marked as system headers unless _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER is defined, we can
+// simply disable this pushing and popping when _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER isn't defined.
+# ifdef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
# define _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS \
_LIBCPP_DIAGNOSTIC_PUSH \
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++11-extensions") \
More information about the libcxx-commits
mailing list