diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -337,7 +337,7 @@ # 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 --- 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 --- 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 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -422,7 +422,7 @@ "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 },