[libc++][format] Use forwarding references.This implements a not accepted LWG issue. Not doing so would requireintegral types to use the handle class instead of being directly storedin the basic_
[libc++][format] Use forwarding references.This implements a not accepted LWG issue. Not doing so would requireintegral types to use the handle class instead of being directly storedin the basic_format_arg.The previous code used `std::forward` in places where it wasn't requiredby the Standard. These are now removed.Implements:- P2418R2 Add support for std::generator-like types to std::format- LWG 3631 basic_format_arg(T&&) should use remove_cvref_t<T> throughoutReviewed By: ldionne, #libcDifferential Revision: https://reviews.llvm.org/D127570
show more ...
[libc++] Remove macros for IBM compilerIt's not tested or used anymore -- instead a Clang-based compiler isused on IBM nowadays.Differential Revision: https://reviews.llvm.org/D127650
[runtimes] Rename various libcpp-has-no-XYZ Lit features to just no-XYZSince those features are general properties of the environment, it makessense to use them from libc++abi too, and so the name
[runtimes] Rename various libcpp-has-no-XYZ Lit features to just no-XYZSince those features are general properties of the environment, it makessense to use them from libc++abi too, and so the name libcpp-has-no-xxxdoesn't make sense.Differential Revision: https://reviews.llvm.org/D126482
[libc++][format] Improve format-arg-store.This optimizes the __format_arg_store type to allow a more efficientstorage of the basic_format_args.It stores the data in two arrays:- A struct with t
[libc++][format] Improve format-arg-store.This optimizes the __format_arg_store type to allow a more efficientstorage of the basic_format_args.It stores the data in two arrays:- A struct with the tag of the exposition only variant's type and the offset of the element in the data array. Since this array only depends on the type information it's calculated at compile time and can be shared by different instances of this class.- The arguments converted to the types used in the exposition only variant of basic_format_arg. This means the packed data can be directly copied to an element of this variant.The new code uses rvalue reference arguments in preparation for P2418.The handle class also has some changes to prepare for P2418. The realchanged for P2418 will be done separately, but these parts make iteasier to implement that paper.Some parts of existing test code are removed since they were no longervalid after the changes, but new tests have been added.Implements parts of:- P2418 Add support for std::generator-like types to std::formatCompletes:- LWG3473 Normative encouragement in non-normative noteDepends on D121138Reviewed By: #libc, vitaut, MordanteDifferential Revision: https://reviews.llvm.org/D121514
[NFC][libc++][format] Enable unit tests.The GCC failures were partly fixed in D124103.The format functions tests are fixed on GCC but they require a hugeamount of RAM (>10 GB). This fails with p
[NFC][libc++][format] Enable unit tests.The GCC failures were partly fixed in D124103.The format functions tests are fixed on GCC but they require a hugeamount of RAM (>10 GB). This fails with parallel testing in the CI. Itcan be solved by splitting the test, but GCC-12 will be released shortlyand might fix the memory usage in these tests. Therefore these testsremain disabled.Reviewed By: #libc, ldionneDifferential Revision: https://reviews.llvm.org/D124335
[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.All supported compilers that support C++20 now support concepts. So, remove`_LIB_LIBCPP_HAS_NO_CONCEPTS` in favor of `_LIBC
[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.All supported compilers that support C++20 now support concepts. So, remove`_LIB_LIBCPP_HAS_NO_CONCEPTS` in favor of `_LIBCPP_STD_VER > 17`. Similarly inthe tests, remove `// UNSUPPORTED: libcpp-no-concepts`.Differential Revision: https://reviews.llvm.org/D121528
[libc++][nfc] Add TEST_HAS_NO_CHAR8_T.This avoids using an libc++ internal macro in our tests. This versiondoesn't depend on the internal macro but redefines it.Reviewed By: #libc, ldionneDiff
[libc++][nfc] Add TEST_HAS_NO_CHAR8_T.This avoids using an libc++ internal macro in our tests. This versiondoesn't depend on the internal macro but redefines it.Reviewed By: #libc, ldionneDifferential Revision: https://reviews.llvm.org/D119460
[libc++][nfc] Add TEST_HAS_NO_UNICODE_CHARS.This avoids using an libc++ internal macro in our tests.Reviewed By: #libc, philnik, ldionneDifferential Revision: https://reviews.llvm.org/D118832
[libc++][format] Adds formatter handle.This implements the handler according to P0645. P2418 changes the wordingin the Standard. That isn't implemented and requires changes in moreplaces. LWG3631
[libc++][format] Adds formatter handle.This implements the handler according to P0645. P2418 changes the wordingin the Standard. That isn't implemented and requires changes in moreplaces. LWG3631 applies modifications to P2418, but is currentlyunresolved.Implements parts of:* P0645 Text FormattingDepends on D115989Reviewed By: ldionne, #libcDifferential Revision: https://reviews.llvm.org/D115991
[libcxx][test] test _LIBCPP_VERSION with #ifdef, not #if
[libcxx][test] Add missing includes and suppress warnings... from testing with MSVC's STL. Mostly truncation warnings and variables that are only used in `LIBCPP_ASSERT`.Differential Revision: ht
[libcxx][test] Add missing includes and suppress warnings... from testing with MSVC's STL. Mostly truncation warnings and variables that are only used in `LIBCPP_ASSERT`.Differential Revision: https://reviews.llvm.org/D116878
[libc++][format][1/6] Reduce binary size.This removes the `format_args_t` from `<format>` and adjusts the type ofthe `format_args` for the `vformat_to` overloads.The `format_context` uses a `bac
[libc++][format][1/6] Reduce binary size.This removes the `format_args_t` from `<format>` and adjusts the type ofthe `format_args` for the `vformat_to` overloads.The `format_context` uses a `back_insert_iterator<string>` therefore thenew `output_iterator` function uses a `string` as its temporary storagebuffer. This isn't ideal. The next patches in this series will improvethis. These improvements make it easy to also improve `format_to_n` and`formatted_size`.This addresses P2216 `6. Binary size`.P2216 `5. Compile-time checks` are not part of this change.Implements parts of:- P2216 std::format improvementsDepends on D103670Reviewed By: ldionne, #libcDifferential Revision: https://reviews.llvm.org/D110494
[libc++] Add an option to disable wide character support in libc++Some embedded platforms do not wish to support the C library functionalityfor handling wchar_t because they have no use for it. It
[libc++] Add an option to disable wide character support in libc++Some embedded platforms do not wish to support the C library functionalityfor handling wchar_t because they have no use for it. It makes sense forlibc++ to work properly on those platforms, so this commit adds a carve-outof functionality for wchar_t.Unfortunately, unlike some other carve-outs (e.g. random device), thispatch touches several parts of the library. However, despite the wideimpact of this patch, I still think it is important to support thisconfiguration since it makes it much simpler to port libc++ to someembedded platforms.Differential Revision: https://reviews.llvm.org/D111265
[libc++][NFC] Qualify usage of nullptr_t in the format tests
[libc++][format] Implement formatters.This implements the initial version of the `std::formatter` class and its specializations. It also implements the following formatting functions:- `format`-
[libc++][format] Implement formatters.This implements the initial version of the `std::formatter` class and its specializations. It also implements the following formatting functions:- `format`- `vformat`- `format_to`- `vformat_to`- `format_to_n`- `formatted_size`All functions have a `char` and `wchar_t` version. Parsing the format-spec andusing the parsed format-spec hasn't been implemented. The code isn't optimized,neither for speed, nor for size.The goal is to have the rudimentary basics working, which can be used as abasis to improve upon. The formatters used in this commit are simple stubs thatwill be replaced by real formatters in later commits.The formatters that are slated to be replaced in this patch series don't havean availability macro to avoid merge conflicts.Note the formatter for `bool` uses `0` and `1` instead of "false" and"true". This will be fixed when the stub is replaced with a realformatter.Implements parts of:- P0645 Text FormattingCompletes:- LWG3539 format_to must not copy models of output_iterator<const charT&>Reviewed By: ldionne, #libc, vitautDifferential Revision: https://reviews.llvm.org/D96664
[libc++][format] Add __format_arg_store.This implements the struct `__format_arg_store` and its dependencies:* the class basic_format_arg,* the class basic_format_args,* the class basic_format_c
[libc++][format] Add __format_arg_store.This implements the struct `__format_arg_store` and its dependencies:* the class basic_format_arg,* the class basic_format_args,* the class basic_format_context,* the function make_format_args,* the function wmake_format_args,* the function visit_format_arg,* several Standard required typedefs.The following parts will be implemented in a later patch:* the child class `basic_format_arg::handle`,* the function `basic_format_arg::basic_format_arg(const T* p)`.The following extension has been implemented:* the class basic_format_arg supports `__[u]int128_t` on platform where libc++ supports 128 bit integrals.Implements parts of:* P0645 Text FormattingCompletes:* LWG3371 visit_format_arg and make_format_args are not hidden friends* LWG3542 basic_format_arg mishandles basic_string_view with custom traitsNote https://mordante.github.io/blog/2021/06/05/format.html gives a bit more information about the goals and non-goals of this initial patch series.Reviewed By: #libc, ldionne, vitautDifferential Revision: https://reviews.llvm.org/D103357