diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -149,7 +149,7 @@ __cpp_lib_three_way_comparison 201907L __cpp_lib_to_address 201711L __cpp_lib_to_array 201907L -__cpp_lib_to_chars 201611L +__cpp_lib_to_chars 201611L __cpp_lib_to_underlying 202102L __cpp_lib_transformation_trait_aliases 201304L __cpp_lib_transparent_operators 201510L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// feature macros - -/* Constant Value - __cpp_lib_to_chars 201611L - -*/ - -#include -#include -#include "test_macros.h" - -int main(int, char**) -{ -// ensure that the macros that are supposed to be defined in are defined. - -/* -#if !defined(__cpp_lib_fooby) -# error "__cpp_lib_fooby is not defined" -#elif __cpp_lib_fooby < 201606L -# error "__cpp_lib_fooby has an invalid value" -#endif -*/ - - return 0; -} diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.pass.cpp @@ -0,0 +1,84 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. +// +// clang-format off + +// + +// Test the feature test macros defined by + +/* Constant Value + __cpp_lib_to_chars 201611L [C++17] +*/ + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++17" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++17" +# endif +# else // _LIBCPP_VERSION +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++20" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++20" +# endif +# else // _LIBCPP_VERSION +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 20 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++2b" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++2b" +# endif +# else // _LIBCPP_VERSION +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 20 + +int main(int, char**) { return 0; } diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp deleted file mode 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// feature macros - -/* Constant Value - __cpp_lib_memory_resource 201603L - -*/ - -// XFAIL -// #include -#include -#include "test_macros.h" - -int main(int, char**) -{ -// ensure that the macros that are supposed to be defined in are defined. - -/* -#if !defined(__cpp_lib_fooby) -# error "__cpp_lib_fooby is not defined" -#elif __cpp_lib_fooby < 201606L -# error "__cpp_lib_fooby has an invalid value" -#endif -*/ - - return 0; -} diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.pass.cpp --- a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.pass.cpp @@ -21,7 +21,6 @@ __cpp_lib_exchange_function 201304L [C++14] __cpp_lib_integer_comparison_functions 202002L [C++20] __cpp_lib_integer_sequence 201304L [C++14] - __cpp_lib_to_chars 201611L [C++17] __cpp_lib_to_underlying 202102L [C++2b] __cpp_lib_tuples_by_type 201304L [C++14] */ @@ -51,10 +50,6 @@ # error "__cpp_lib_integer_sequence should not be defined before c++14" # endif -# ifdef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should not be defined before c++17" -# endif - # ifdef __cpp_lib_to_underlying # error "__cpp_lib_to_underlying should not be defined before c++2b" # endif @@ -91,10 +86,6 @@ # error "__cpp_lib_integer_sequence should have the value 201304L in c++14" # endif -# ifdef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should not be defined before c++17" -# endif - # ifdef __cpp_lib_to_underlying # error "__cpp_lib_to_underlying should not be defined before c++2b" # endif @@ -137,19 +128,6 @@ # error "__cpp_lib_integer_sequence should have the value 201304L in c++17" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should be defined in c++17" -# endif -# if __cpp_lib_to_chars != 201611L -# error "__cpp_lib_to_chars should have the value 201611L in c++17" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" -# endif -# endif - # ifdef __cpp_lib_to_underlying # error "__cpp_lib_to_underlying should not be defined before c++2b" # endif @@ -204,19 +182,6 @@ # error "__cpp_lib_integer_sequence should have the value 201304L in c++20" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should be defined in c++20" -# endif -# if __cpp_lib_to_chars != 201611L -# error "__cpp_lib_to_chars should have the value 201611L in c++20" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" -# endif -# endif - # ifdef __cpp_lib_to_underlying # error "__cpp_lib_to_underlying should not be defined before c++2b" # endif @@ -271,19 +236,6 @@ # error "__cpp_lib_integer_sequence should have the value 201304L in c++2b" # endif -# if !defined(_LIBCPP_VERSION) -# ifndef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should be defined in c++2b" -# endif -# if __cpp_lib_to_chars != 201611L -# error "__cpp_lib_to_chars should have the value 201611L in c++2b" -# endif -# else // _LIBCPP_VERSION -# ifdef __cpp_lib_to_chars -# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" -# endif -# endif - # ifndef __cpp_lib_to_underlying # error "__cpp_lib_to_underlying should be defined in c++2b" # endif 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 @@ -596,7 +596,7 @@ }, { "name": "__cpp_lib_to_chars", "values": { "c++17": 201611 }, - "headers": ["utility"], + "headers": ["charconv"], "unimplemented": True, }, { "name": "__cpp_lib_to_underlying",