[libc++] Remove availability markup for std::format
authorLouis Dionne <ldionne.2@gmail.com>
Thu, 16 Mar 2023 17:09:44 +0000 (13:09 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Wed, 22 Mar 2023 20:32:26 +0000 (16:32 -0400)
commit3d334df58742ff53fb00aa3caeb7eb5da3436348
tree55ba8644be87fa829ffc44c9d31612fa02d5edde
parent77ed8311a625f449e7ee8bebda3b2940be6dc211
[libc++] Remove availability markup for std::format

std::format is currently experimental, so there is technically no
deployment target requirement for it (since the only symbols required
for it are in `libc++experimental.a`).

However, some parts of std::format depend indirectly on the floating
point std::to_chars implementation, which does have deployment target
requirements.

This patch removes all the availability format for std::format and
updates the XFAILs in the tests to properly explain why they fail
on old deployment targets, when they do. It also changes a couple
of tests to avoid depending on floating-point std::to_chars when
it isn't fundamental to the test.

Finally, some tests are marked as XFAIL but I added a comment saying

   TODO FMT This test should not require std::to_chars(floating-point)

These tests do not fundamentally depend on floating-point std::to_chars,
however they end up failing because calling std::format even without a
floating-point argument to format will end up requiring floating-point
std::to_chars. I believe this is an implementation artifact that could
be avoided in all cases where we know the format string at compile-time.
In the tests, I added the TODO comment only to the places where we could
do better and actually avoid relying on floating-point std::to_chars
because we know the format string at compile-time.

Differential Revision: https://reviews.llvm.org/D134598
129 files changed:
libcxx/include/__availability
libcxx/include/__chrono/formatter.h
libcxx/include/__chrono/ostream.h
libcxx/include/__format/container_adaptor.h
libcxx/include/__format/format_arg.h
libcxx/include/__format/format_args.h
libcxx/include/__format/format_context.h
libcxx/include/__format/format_functions.h
libcxx/include/__format/format_fwd.h
libcxx/include/__format/format_parse_context.h
libcxx/include/__format/formatter.h
libcxx/include/__format/formatter_bool.h
libcxx/include/__format/formatter_char.h
libcxx/include/__format/formatter_floating_point.h
libcxx/include/__format/formatter_integer.h
libcxx/include/__format/formatter_pointer.h
libcxx/include/__format/formatter_string.h
libcxx/include/__format/formatter_tuple.h
libcxx/include/__format/range_default_formatter.h
libcxx/include/__format/range_formatter.h
libcxx/include/vector
libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.format.pass.cpp
libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.vformat.pass.cpp
libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.pass.cpp
libcxx/test/std/containers/container.adaptors/container.adaptors.format/parse.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.format.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.vformat.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/parse.pass.cpp
libcxx/test/std/time/time.cal/time.cal.day/time.cal.day.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.md/time.cal.md.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.wdidx/time.cal.wdidx.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.wdlast/time.cal.wdlast.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.weekday/time.cal.weekday.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.year/time.cal.year.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp
libcxx/test/std/time/time.hms/time.hms.nonmembers/ostream.pass.cpp
libcxx/test/std/time/time.syn/formatter.day.pass.cpp
libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
libcxx/test/std/time/time.syn/formatter.month.pass.cpp
libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
libcxx/test/std/time/time.syn/formatter.year.pass.cpp
libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.pass.cpp
libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
libcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
libcxx/test/std/utilities/format/format.error/format.error.pass.cpp
libcxx/test/std/utilities/format/format.fmt.string/ctor.verify.cpp
libcxx/test/std/utilities/format/format.fmt.string/get.pass.cpp
libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp
libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
libcxx/test/std/utilities/format/format.formattable/concept.formattable.float.compile.pass.cpp [new file with mode: 0644]
libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp
libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp
libcxx/test/std/utilities/format/format.functions/escaped_output.ascii.pass.cpp
libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp
libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp
libcxx/test/std/utilities/format/format.functions/format.pass.cpp
libcxx/test/std/utilities/format/format.functions/format.verify.cpp
libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp
libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp
libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp
libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp
libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp
libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp
libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp
libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtdef/format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtdef/parse.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_brackets.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtdef/set_separator.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtkind/format_kind.compile.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.vformat.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtmap/parse.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.vformat.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.fmtset/parse.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.vformat.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/format.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/parse.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/set_brackets.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/set_separator.pass.cpp
libcxx/test/std/utilities/format/format.range/format.range.formatter/underlying.pass.cpp
libcxx/test/std/utilities/format/format.tuple/format.functions.format.pass.cpp
libcxx/test/std/utilities/format/format.tuple/format.functions.format.verify.cpp
libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp
libcxx/test/std/utilities/format/format.tuple/format.pass.cpp
libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
libcxx/test/std/utilities/format/format.tuple/set_brackets.pass.cpp
libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp
libcxx/utils/ci/run-buildbot