Skip to content

Commit dff62f5

Browse files
committed
[libc++][format] Removes the experimental status.
The code has been quite ready for a while now and there are no more ABI breaking papers. So this is a good time to mark the feature as stable. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D150802
1 parent bb4f88f commit dff62f5

File tree

183 files changed

+40
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+40
-259
lines changed

libcxx/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ Improvements and New Features
5959
- `D122780 <https://reviews.llvm.org/D122780>`_ Improved the performance of ``std::sort`` and ``std::ranges::sort``
6060
by up to 50% for arithmetic types and by approximately 10% for other types.
6161

62+
- The ``<format>`` header is no longer considered experimental. Some
63+
``std::formatter`` specializations are not yet available since the class used
64+
in the specialization has not been implemented in libc++. This prevents the
65+
feature-test macro to be set.
66+
6267
Deprecations and Removals
6368
-------------------------
6469

libcxx/include/__chrono/formatter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
_LIBCPP_BEGIN_NAMESPACE_STD
5555

56-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
56+
#if _LIBCPP_STD_VER >= 20
5757

5858
namespace __formatter {
5959

@@ -825,7 +825,7 @@ struct formatter<chrono::hh_mm_ss<_Duration>, _CharT> : public __formatter_chron
825825
return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__time);
826826
}
827827
};
828-
#endif // if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
828+
#endif // if _LIBCPP_STD_VER >= 20
829829

830830
_LIBCPP_END_NAMESPACE_STD
831831

libcxx/include/__chrono/ostream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
_LIBCPP_BEGIN_NAMESPACE_STD
3939

40-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
40+
#if _LIBCPP_STD_VER >= 20
4141

4242
namespace chrono {
4343

@@ -257,7 +257,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const hh_mm_ss<_Duration> __hms
257257

258258
} // namespace chrono
259259

260-
#endif // if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
260+
#endif // if _LIBCPP_STD_VER >= 20
261261

262262
_LIBCPP_END_NAMESPACE_STD
263263

libcxx/include/__chrono/parser_std_format_spec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
_LIBCPP_BEGIN_NAMESPACE_STD
2626

27-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
27+
#if _LIBCPP_STD_VER >= 20
2828

2929
namespace __format_spec {
3030

@@ -409,7 +409,7 @@ class _LIBCPP_TEMPLATE_VIS __parser_chrono {
409409

410410
} // namespace __format_spec
411411

412-
#endif //_LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
412+
#endif //_LIBCPP_STD_VER >= 20
413413

414414
_LIBCPP_END_NAMESPACE_STD
415415

libcxx/include/__config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@
273273
// Incomplete features get their own specific disabling flags. This makes it
274274
// easier to grep for target specific flags once the feature is complete.
275275
# if !defined(_LIBCPP_ENABLE_EXPERIMENTAL) && !defined(_LIBCPP_BUILDING_LIBRARY)
276-
# define _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
277276
# define _LIBCPP_HAS_NO_INCOMPLETE_PSTL
278277
# endif
279278

libcxx/include/__format/format_functions.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
#ifndef _LIBCPP___FORMAT_FORMAT_FUNCTIONS
1111
#define _LIBCPP___FORMAT_FORMAT_FUNCTIONS
1212

13-
// TODO FMT This is added to fix Apple back-deployment.
14-
#include <version>
15-
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
16-
1713
#include <__algorithm/clamp.h>
1814
#include <__availability>
1915
#include <__concepts/convertible_to.h>
@@ -678,6 +674,4 @@ formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args)
678674

679675
_LIBCPP_END_NAMESPACE_STD
680676

681-
#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
682-
683677
#endif // _LIBCPP___FORMAT_FORMAT_FUNCTIONS

libcxx/include/chrono

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ constexpr chrono::year operator ""y(unsigned lo
801801
// [time.syn]
802802
#include <compare>
803803

804-
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && _LIBCPP_STD_VER >= 20
804+
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && _LIBCPP_STD_VER >= 20
805805
# include <__chrono/formatter.h>
806806
# include <__chrono/ostream.h>
807807
# include <__chrono/parser_std_format_spec.h>

libcxx/include/format

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ namespace std {
170170
*/
171171

172172
#include <__assert> // all public C++ headers provide the assertion handler
173-
// Make sure all feature-test macros are available.
174-
#include <version>
175-
// Enable the contents of the header only when libc++ was built with experimental features enabled.
176-
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
177-
178173
#include <__config>
179174
#include <__format/buffer.h>
180175
#include <__format/concepts.h>
@@ -202,11 +197,10 @@ namespace std {
202197
#include <__format/range_default_formatter.h>
203198
#include <__format/range_formatter.h>
204199
#include <__format/unicode.h>
200+
#include <version>
205201

206202
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
207203
# pragma GCC system_header
208204
#endif
209205

210-
#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
211-
212206
#endif // _LIBCPP_FORMAT

libcxx/include/vector

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3524,7 +3524,7 @@ inline constexpr bool __format::__enable_insertable<vector<wchar_t>> = true;
35243524

35253525
#endif // _LIBCPP_STD_VER >= 20
35263526

3527-
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && _LIBCPP_STD_VER >= 23
3527+
#if _LIBCPP_STD_VER >= 23
35283528
template <class _Tp, class CharT>
35293529
// Since is-vector-bool-reference is only used once it's inlined here.
35303530
requires same_as<typename _Tp::__container, vector<bool, typename _Tp::__container::allocator_type>>
@@ -3543,7 +3543,7 @@ public:
35433543
return __underlying_.format(__ref, __ctx);
35443544
}
35453545
};
3546-
#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && _LIBCPP_STD_VER >= 23
3546+
#endif // _LIBCPP_STD_VER >= 23
35473547

35483548
_LIBCPP_END_NAMESPACE_STD
35493549

libcxx/include/version

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,7 @@ __cpp_lib_void_t 201411L <type_traits>
341341
# define __cpp_lib_erase_if 202002L
342342
# undef __cpp_lib_execution
343343
// # define __cpp_lib_execution 201902L
344-
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
345-
// # define __cpp_lib_format 202106L
346-
# endif
344+
// # define __cpp_lib_format 202106L
347345
# define __cpp_lib_generic_unordered_lookup 201811L
348346
# define __cpp_lib_int_pow2 202002L
349347
# define __cpp_lib_integer_comparison_functions 202002L
@@ -400,12 +398,8 @@ __cpp_lib_void_t 201411L <type_traits>
400398
# define __cpp_lib_constexpr_memory 202202L
401399
# define __cpp_lib_constexpr_typeinfo 202106L
402400
# define __cpp_lib_expected 202211L
403-
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
404-
# define __cpp_lib_format_ranges 202207L
405-
# endif
406-
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
407-
// # define __cpp_lib_formatters 202302L
408-
# endif
401+
# define __cpp_lib_format_ranges 202207L
402+
// # define __cpp_lib_formatters 202302L
409403
# define __cpp_lib_forward_like 202207L
410404
# define __cpp_lib_invoke_r 202106L
411405
# define __cpp_lib_is_scoped_enum 202011L

libcxx/test/libcxx/experimental/fexperimental-library.compile.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@
2222
// ADDITIONAL_COMPILE_FLAGS: -fexperimental-library
2323

2424
#include <version>
25-
26-
#ifdef _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
27-
# error "-fexperimental-library should enable <format>"
28-
#endif

libcxx/test/libcxx/time/convert_to_tm.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// <chrono>
1211

libcxx/test/libcxx/transitive_includes.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
// This test doesn't support being run when some headers are not available, since we
2020
// would need to add significant complexity to make that work.
21-
// UNSUPPORTED: no-localization, no-threads, no-wide-characters, no-filesystem, libcpp-has-no-incomplete-format
21+
// UNSUPPORTED: no-localization, no-threads, no-wide-characters, no-filesystem
2222

2323
// When built with modules, this test doesn't work because --trace-includes doesn't
2424
// report the stack of includes correctly.

libcxx/test/libcxx/utilities/format/enable_insertable.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// <format>
1211

libcxx/test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// <format>
1211

libcxx/test/libcxx/utilities/format/format.formatter/format.context/types.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// <format>
1211

libcxx/test/libcxx/utilities/format/format.string/format.string.std/code_point_width_estimation.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109
// TODO FMT Fix this test using GCC, it currently times out.
1110
// UNSUPPORTED: gcc-12
1211

libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109
// TODO FMT Fix this test using GCC, it currently times out.
1110
// UNSUPPORTED: gcc-12
1211

libcxx/test/libcxx/utilities/format/version.compile.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
10-
119
// <format>
1210

1311
#include <format>

libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.format.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.vformat.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/container.adaptors/container.adaptors.format/parse.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/container.adaptors/container.adaptors.format/types.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// [container.adaptors.format]/1
1211
// For each of queue, priority_queue, and stack, the library provides the

libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/parse.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// TODO FMT Fix this test using GCC, it currently times out.
1211
// UNSUPPORTED: gcc-12

libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/types.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//===----------------------------------------------------------------------===//
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
9-
// UNSUPPORTED: libcpp-has-no-incomplete-format
109

1110
// <vector>
1211

libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
//
1212
// clang-format off
1313

14-
// UNSUPPORTED: libcpp-has-no-incomplete-format
15-
1614
// <format>
1715

1816
// Test the feature test macros defined by <format>
@@ -89,17 +87,11 @@
8987
# endif
9088
# endif
9189

92-
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
93-
# ifndef __cpp_lib_format_ranges
94-
# error "__cpp_lib_format_ranges should be defined in c++23"
95-
# endif
96-
# if __cpp_lib_format_ranges != 202207L
97-
# error "__cpp_lib_format_ranges should have the value 202207L in c++23"
98-
# endif
99-
# else
100-
# ifdef __cpp_lib_format_ranges
101-
# error "__cpp_lib_format_ranges should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)' is not met!"
102-
# endif
90+
# ifndef __cpp_lib_format_ranges
91+
# error "__cpp_lib_format_ranges should be defined in c++23"
92+
# endif
93+
# if __cpp_lib_format_ranges != 202207L
94+
# error "__cpp_lib_format_ranges should have the value 202207L in c++23"
10395
# endif
10496

10597
#elif TEST_STD_VER > 23
@@ -117,17 +109,11 @@
117109
# endif
118110
# endif
119111

120-
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
121-
# ifndef __cpp_lib_format_ranges
122-
# error "__cpp_lib_format_ranges should be defined in c++26"
123-
# endif
124-
# if __cpp_lib_format_ranges != 202207L
125-
# error "__cpp_lib_format_ranges should have the value 202207L in c++26"
126-
# endif
127-
# else
128-
# ifdef __cpp_lib_format_ranges
129-
# error "__cpp_lib_format_ranges should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)' is not met!"
130-
# endif
112+
# ifndef __cpp_lib_format_ranges
113+
# error "__cpp_lib_format_ranges should be defined in c++26"
114+
# endif
115+
# if __cpp_lib_format_ranges != 202207L
116+
# error "__cpp_lib_format_ranges should have the value 202207L in c++26"
131117
# endif
132118

133119
#endif // TEST_STD_VER > 23

0 commit comments

Comments
 (0)