[libcxx-commits] [libcxx] 580416d - [libcxx] updates the feature-test macro generator

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 18 10:09:43 PDT 2021


Author: Christopher Di Bella
Date: 2021-03-18T17:08:10Z
New Revision: 580416d573b6e5d33c09467084e382ac78f2a199

URL: https://github.com/llvm/llvm-project/commit/580416d573b6e5d33c09467084e382ac78f2a199
DIFF: https://github.com/llvm/llvm-project/commit/580416d573b6e5d33c09467084e382ac78f2a199.diff

LOG: [libcxx] updates the feature-test macro generator

D97015 didn't correctly update `generate_feature_test_macro_components.py`.

Reviewed By: ldionne, Quuxplusone, #libc, Mordante

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

Added: 
    

Modified: 
    libcxx/include/version
    libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
    libcxx/utils/generate_feature_test_macro_components.py

Removed: 
    


################################################################################
diff  --git a/libcxx/include/version b/libcxx/include/version
index becbfa5c2cdb..469f1cea82b4 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -337,7 +337,7 @@ __cpp_lib_void_t                                        201411L <type_traits>
 #   define __cpp_lib_latch                              201907L
 # endif
 # define __cpp_lib_list_remove_return_type              201806L
-# ifndef _LIBCPP_HAS_NO_CONCEPTS
+# if !defined(_LIBCPP_HAS_NO_CONCEPTS)
 #   define __cpp_lib_math_constants                     201907L
 # endif
 // # define __cpp_lib_polymorphic_allocator                201902L

diff  --git a/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp
index aaa64d1f7feb..00752ded5cfb 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp
@@ -42,7 +42,7 @@
 
 #elif TEST_STD_VER == 20
 
-# ifndef _LIBCPP_HAS_NO_CONCEPTS
+# if defined(__cpp_concepts) && __cpp_concepts >= 201907L
 #   ifndef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should be defined in c++20"
 #   endif
@@ -53,11 +53,11 @@
 #   ifdef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should not be defined when defined(__cpp_concepts) && __cpp_concepts >= 201907L is not defined!"
 #   endif
-# endif // _LIBCPP_HAS_NO_CONCEPTS
+# endif
 
 #elif TEST_STD_VER > 20
 
-# ifndef _LIBCPP_HAS_NO_CONCEPTS
+# if defined(__cpp_concepts) && __cpp_concepts >= 201907L
 #   ifndef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should be defined in c++2b"
 #   endif
@@ -68,7 +68,7 @@
 #   ifdef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should not be defined when defined(__cpp_concepts) && __cpp_concepts >= 201907L is not defined!"
 #   endif
-# endif // _LIBCPP_HAS_NO_CONCEPTS
+# endif
 
 #endif // TEST_STD_VER > 20
 

diff  --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
index 3a668768d5e5..023f8c1b2317 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
@@ -2890,7 +2890,7 @@
 #   error "__cpp_lib_map_try_emplace should have the value 201411L in c++20"
 # endif
 
-# ifndef _LIBCPP_HAS_NO_CONCEPTS
+# if defined(__cpp_concepts) && __cpp_concepts >= 201907L
 #   ifndef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should be defined in c++20"
 #   endif
@@ -2901,7 +2901,7 @@
 #   ifdef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should not be defined when defined(__cpp_concepts) && __cpp_concepts >= 201907L is not defined!"
 #   endif
-# endif // _LIBCPP_HAS_NO_CONCEPTS
+# endif
 
 # if !defined(_LIBCPP_VERSION)
 #   ifndef __cpp_lib_math_special_functions
@@ -4104,7 +4104,7 @@
 #   error "__cpp_lib_map_try_emplace should have the value 201411L in c++2b"
 # endif
 
-# if !_LIBCPP_HAS_NO_CONCEPTS
+# if defined(__cpp_concepts) && __cpp_concepts >= 201907L
 #   ifndef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should be defined in c++2b"
 #   endif
@@ -4115,7 +4115,7 @@
 #   ifdef __cpp_lib_math_constants
 #     error "__cpp_lib_math_constants should not be defined when defined(__cpp_concepts) && __cpp_concepts >= 201907L is not defined!"
 #   endif
-# endif // !_LIBCPP_HAS_NO_CONCEPTS
+# endif
 
 # if !defined(_LIBCPP_VERSION)
 #   ifndef __cpp_lib_math_special_functions

diff  --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 7351da3b2a4d..ce0007610b08 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -422,7 +422,7 @@ def add_version_header(tc):
     "values": { "c++20": 201907 },
     "headers": ["numbers"],
     "depends": "defined(__cpp_concepts) && __cpp_concepts >= 201907L",
-    "internal_depends": "defined(__cpp_concepts) && __cpp_concepts >= 201907L",
+    "internal_depends": "!defined(_LIBCPP_HAS_NO_CONCEPTS)",
   }, {
     "name": "__cpp_lib_math_special_functions",
     "values": { "c++17": 201603 },


        


More information about the libcxx-commits mailing list