diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -78,6 +78,12 @@ reach out to the libc++ developers if you find something missing in the new configuration system. +- The functions ``to_chars`` and ``from_chars`` for integral types are + available starting with C++17. Libc++ offered these functions in C++11 and + C++14 as an undocumented extension. This extension makes it hard to implement + the C++23 paper that makes these functions ``constexpr``, therefore the + extension has been removed. + Upcoming Deprecations and Removals ---------------------------------- diff --git a/libcxx/include/__charconv/chars_format.h b/libcxx/include/__charconv/chars_format.h --- a/libcxx/include/__charconv/chars_format.h +++ b/libcxx/include/__charconv/chars_format.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 14 enum class _LIBCPP_ENUM_VIS chars_format { @@ -70,7 +70,7 @@ return __x; } -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__charconv/from_chars_result.h b/libcxx/include/__charconv/from_chars_result.h --- a/libcxx/include/__charconv/from_chars_result.h +++ b/libcxx/include/__charconv/from_chars_result.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 14 struct _LIBCPP_TYPE_VIS from_chars_result { @@ -30,7 +30,7 @@ # endif }; -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__charconv/tables.h b/libcxx/include/__charconv/tables.h --- a/libcxx/include/__charconv/tables.h +++ b/libcxx/include/__charconv/tables.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 14 namespace __itoa { @@ -173,7 +173,7 @@ } // namespace __itoa -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__charconv/to_chars_base_10.h b/libcxx/include/__charconv/to_chars_base_10.h --- a/libcxx/include/__charconv/to_chars_base_10.h +++ b/libcxx/include/__charconv/to_chars_base_10.h @@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 14 namespace __itoa { @@ -176,7 +176,7 @@ # endif } // namespace __itoa -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__charconv/to_chars_result.h b/libcxx/include/__charconv/to_chars_result.h --- a/libcxx/include/__charconv/to_chars_result.h +++ b/libcxx/include/__charconv/to_chars_result.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 14 struct _LIBCPP_TYPE_VIS to_chars_result { @@ -30,7 +30,7 @@ # endif }; -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -106,7 +106,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 14 to_chars_result to_chars(char*, char*, bool, int = 10) = delete; from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete; @@ -776,10 +776,6 @@ return __from_chars_integral(__first, __last, __value, __base); } -// Floating-point implementation starts here. -// Unlike the other parts of charconv this is only available in C++17 and newer. -#if _LIBCPP_STD_VER > 14 - _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result to_chars(char* __first, char* __last, float __value); @@ -807,8 +803,7 @@ _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision); -# endif // _LIBCPP_STD_VER > 14 -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp --- a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.bool.fail.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 -// UNSUPPORTED: !stdlib=libc++ && c++11 -// UNSUPPORTED: !stdlib=libc++ && c++14 +// UNSUPPORTED: c++03, c++11, c++14 + // // In diff --git a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp --- a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp @@ -6,9 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 -// UNSUPPORTED: !stdlib=libc++ && c++11 -// UNSUPPORTED: !stdlib=libc++ && c++14 +// UNSUPPORTED: c++03, c++11, c++14 // diff --git a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp --- a/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.from.chars/integral.roundtrip.pass.cpp @@ -6,9 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 -// UNSUPPORTED: !stdlib=libc++ && c++11 -// UNSUPPORTED: !stdlib=libc++ && c++14 +// UNSUPPORTED: c++03, c++11, c++14 // diff --git a/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp --- a/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp @@ -6,10 +6,7 @@ // //===----------------------------------------------------------------------===// -// Note: chars_format is a C++17 feature backported to C++11. Assert isn't -// allowed in a constexpr function in C++11. To keep the code readable, C++11 -// support is untested. -// UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: c++03, c++11, c++14 // diff --git a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp --- a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.bool.fail.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 -// UNSUPPORTED: !stdlib=libc++ && c++11 -// UNSUPPORTED: !stdlib=libc++ && c++14 +// UNSUPPORTED: c++03, c++11, c++14 + // // In diff --git a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp --- a/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp +++ b/libcxx/test/std/utilities/charconv/charconv.to.chars/integral.pass.cpp @@ -6,9 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 -// UNSUPPORTED: !stdlib=libc++ && c++11 -// UNSUPPORTED: !stdlib=libc++ && c++14 +// UNSUPPORTED: c++03, c++11, c++14 // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=12712420 // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=12712420