Skip to content

Commit ab65e4a

Browse files
authored
[libc++] Fix disabling of extension warnings in C++20 and later (llvm#134989)
`__has_feature(modules)` is always true in C++20 and later. Instead of using that, just disable extension warnings if they're not ignored through the system header machinery anyways.
1 parent 6a2a8eb commit ab65e4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcxx/include/__config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,9 @@ typedef __char32_t char32_t;
538538
# endif
539539

540540
// Clang modules take a significant compile time hit when pushing and popping diagnostics.
541-
// Since all the headers are marked as system headers in the modulemap, we can simply disable this
542-
// pushing and popping when building with clang modules.
543-
# if !__has_feature(modules)
541+
// Since all the headers are marked as system headers unless _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER is defined, we can
542+
// simply disable this pushing and popping when _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER isn't defined.
543+
# ifdef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
544544
# define _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS \
545545
_LIBCPP_DIAGNOSTIC_PUSH \
546546
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++11-extensions") \

0 commit comments

Comments
 (0)