diff --git a/libcxx/include/numbers b/libcxx/include/numbers --- a/libcxx/include/numbers +++ b/libcxx/include/numbers @@ -60,7 +60,7 @@ #include <__config> -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L #include #include @@ -136,6 +136,6 @@ _LIBCPP_POP_MACROS -#endif //_LIBCPP_STD_VER > 17 +#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L #endif // _LIBCPP_NUMBERS diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -238,7 +238,9 @@ # define __cpp_lib_is_constant_evaluated 201811L # endif # define __cpp_lib_list_remove_return_type 201806L -# define __cpp_lib_math_constants 201907L +# if defined(__cpp_concepts) && __cpp_concepts >= 201811L +# define __cpp_lib_math_constants 201907L +# endif // # define __cpp_lib_ranges 201811L # define __cpp_lib_span 202002L // # define __cpp_lib_three_way_comparison 201711L 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 @@ -40,11 +40,17 @@ #elif TEST_STD_VER > 17 -# ifndef __cpp_lib_math_constants -# error "__cpp_lib_math_constants should be defined in c++2a" -# endif -# if __cpp_lib_math_constants != 201907L -# error "__cpp_lib_math_constants should have the value 201907L in c++2a" +# if defined(__cpp_concepts) && __cpp_concepts >= 201811L +# ifndef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should be defined in c++2a" +# endif +# if __cpp_lib_math_constants != 201907L +# error "__cpp_lib_math_constants should have the value 201907L in c++2a" +# endif +# else +# ifdef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should not be defined when defined(__cpp_concepts) && __cpp_concepts >= 201811L is not defined!" +# endif # endif #endif // TEST_STD_VER > 17 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 @@ -1980,11 +1980,17 @@ # error "__cpp_lib_map_try_emplace should have the value 201411L in c++2a" # endif -# ifndef __cpp_lib_math_constants -# error "__cpp_lib_math_constants should be defined in c++2a" -# endif -# if __cpp_lib_math_constants != 201907L -# error "__cpp_lib_math_constants should have the value 201907L in c++2a" +# if defined(__cpp_concepts) && __cpp_concepts >= 201811L +# ifndef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should be defined in c++2a" +# endif +# if __cpp_lib_math_constants != 201907L +# error "__cpp_lib_math_constants should have the value 201907L in c++2a" +# endif +# else +# ifdef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should not be defined when defined(__cpp_concepts) && __cpp_concepts >= 201811L is not defined!" +# endif # endif # if !defined(_LIBCPP_VERSION) diff --git a/libcxx/test/std/numerics/numbers/defined.pass.cpp b/libcxx/test/std/numerics/numbers/defined.pass.cpp --- a/libcxx/test/std/numerics/numbers/defined.pass.cpp +++ b/libcxx/test/std/numerics/numbers/defined.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: libcpp-no-concepts #include diff --git a/libcxx/test/std/numerics/numbers/illformed.verify.cpp b/libcxx/test/std/numerics/numbers/illformed.verify.cpp --- a/libcxx/test/std/numerics/numbers/illformed.verify.cpp +++ b/libcxx/test/std/numerics/numbers/illformed.verify.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: libcpp-no-concepts #include diff --git a/libcxx/test/std/numerics/numbers/specialize.pass.cpp b/libcxx/test/std/numerics/numbers/specialize.pass.cpp --- a/libcxx/test/std/numerics/numbers/specialize.pass.cpp +++ b/libcxx/test/std/numerics/numbers/specialize.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: libcpp-no-concepts #include #include diff --git a/libcxx/test/std/numerics/numbers/user_type.pass.cpp b/libcxx/test/std/numerics/numbers/user_type.pass.cpp --- a/libcxx/test/std/numerics/numbers/user_type.pass.cpp +++ b/libcxx/test/std/numerics/numbers/user_type.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: libcpp-no-concepts #include diff --git a/libcxx/test/std/numerics/numbers/value.pass.cpp b/libcxx/test/std/numerics/numbers/value.pass.cpp --- a/libcxx/test/std/numerics/numbers/value.pass.cpp +++ b/libcxx/test/std/numerics/numbers/value.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: libcpp-no-concepts #include #include 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 @@ -604,6 +604,8 @@ "c++2a": int(201907), }, "headers": ["numbers"], + "depends": "defined(__cpp_concepts) && __cpp_concepts >= 201811L", + "internal_depends": "defined(__cpp_concepts) && __cpp_concepts >= 201811L", }, ]], key=lambda tc: tc["name"])