[libcxx-commits] [libcxx] 9333d34 - [libc++] Disable #pragma system_header in the new testing configuration

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 19 11:38:38 PDT 2021


Author: Louis Dionne
Date: 2021-07-19T14:38:24-04:00
New Revision: 9333d34b8a788869a545701110ccce5662d0eb47

URL: https://github.com/llvm/llvm-project/commit/9333d34b8a788869a545701110ccce5662d0eb47
DIFF: https://github.com/llvm/llvm-project/commit/9333d34b8a788869a545701110ccce5662d0eb47.diff

LOG: [libc++] Disable #pragma system_header in the new testing configuration

The new testing configuration did not turn off #pragma system_header,
which means we were not seeing warnings in system headers.

Differential Revision: https://reviews.llvm.org/D106187

Added: 
    

Modified: 
    libcxx/utils/libcxx/test/config.py
    libcxx/utils/libcxx/test/features.py

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index f7117ca57b1eb..3cd0db454964b 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -286,12 +286,6 @@ def configure_default_compile_flags(self):
         support_path = os.path.join(self.libcxx_src_root, 'test/support')
         self.cxx.compile_flags += ['-I' + support_path]
 
-        # On GCC, the libc++ headers cause errors due to throw() decorators
-        # on operator new clashing with those from the test suite, so we
-        # don't enable warnings in system headers on GCC.
-        if self.cxx.type != 'gcc':
-            self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER']
-
         # Add includes for the PSTL headers
         pstl_src_root = self.get_lit_conf('pstl_src_root')
         pstl_obj_root = self.get_lit_conf('pstl_obj_root')

diff  --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 77ba85e4611c5..d9b092cd5dd42 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -66,7 +66,8 @@
   Feature(name=lambda cfg: 'apple-clang-{__clang_major__}.{__clang_minor__}'.format(**compilerMacros(cfg)),                        when=_isAppleClang),
   Feature(name=lambda cfg: 'apple-clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}'.format(**compilerMacros(cfg)), when=_isAppleClang),
 
-  Feature(name='clang',                                                                                                            when=_isClang),
+  Feature(name='clang',                                                                                                            when=_isClang,
+          actions=[AddCompileFlag('-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER')]),
   Feature(name=lambda cfg: 'clang-{__clang_major__}'.format(**compilerMacros(cfg)),                                                when=_isClang),
   Feature(name=lambda cfg: 'clang-{__clang_major__}.{__clang_minor__}'.format(**compilerMacros(cfg)),                              when=_isClang),
   Feature(name=lambda cfg: 'clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}'.format(**compilerMacros(cfg)),       when=_isClang),


        


More information about the libcxx-commits mailing list