Commit Graph

9609 Commits

Author SHA1 Message Date
Louis Dionne d529e8110b [libc++] Fix compilation error on platforms that don't implement std::tm
Instead of mentioning tm directly in the definition of __convert_to_tm,
take it as a template argument. As a fly-by also fix incorrect Lit feature
(should have been no-localization instead of libcpp-has-no-localization).

Differential Revision: https://reviews.llvm.org/D133490
2022-09-08 18:10:53 -04:00
Mark de Wever 3695cf2065 [libc++] Removes Clang 13 support.
Reviewed By: #libc, ldionne, jloser

Differential Revision: https://reviews.llvm.org/D133435
2022-09-08 17:51:52 +02:00
Mark de Wever de4a2b7381 [libc++] Fixes CI.
It seems merging the changes in transitive macros and recent commits
conflicted.
2022-09-07 19:58:21 +02:00
Mark de Wever ab7b776cf9 [libc++][locale] Removes an transitive include.
Removes <cstdarg> transitive include from <locale> in C++23.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D133254
2022-09-07 18:54:26 +02:00
Mark de Wever e5d2d3eafb [libc++][chrono] Implements formatter day.
This implements the enabled specializaton
template<class charT> struct formatter<chrono::day, charT>;

and
template<class charT, class traits>
    basic_ostream<charT, traits>&
      operator<<(basic_ostream<charT, traits>& os, const day& d);

Implements:
- LWG 3241 chrono-spec grammar ambiguity in §[time.format]

Partially implements:
- P1361 Integration of chrono with text formatting

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D128577
2022-09-07 18:44:04 +02:00
Mark de Wever b490c8a662 [libc++][format] Updates feature-test macros.
During the discussion on the SG-10 mailinglist regarding the format
feature-test macros voted in during the last plenary it turns out libc++
can't mark the format feature-test macro as implemented.

According to
  https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#__cpp_lib_format
the not yet implemented paper
  P1361R2 Integration of chrono with text formatting
affects the feature test macro.

Note that P1361R2 doesn't mention the feature-test macro nor is there an
LWG-issue to address the issue. The reporter of the issue didn't recall
where this requirement exactly has been decided.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D133271
2022-09-07 18:39:39 +02:00
Vitaly Buka beb413acce [test][libcxx] Mark ubsan test as UNSUPPORTED
It inconsistently fails on bots.
2022-09-06 13:44:28 -07:00
Matheus Izvekov 94c6dfbaeb
[clang] Implement setting crash_diagnostics_dir through env variable
This implements setting the equivalent of `-fcrash-diagnostics-dir`
through the environment variable `CLANG_CRASH_DIAGNOSTICS_DIR`.
If present, the flag still takes precedence.

This helps integration with test frameworks and pipelines.

With this feature, we change the libcxx bootstrapping build
pipeline to produce clang crash reproducers as artifacts.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D133082
2022-09-06 19:27:37 +02:00
Nikolas Klauser 5fab33af7f [libc++] Avoid instantiating type_trait classes
Use `using` aliases to avoid instantiating lots of types

Reviewed By: ldionne, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D132785
2022-09-06 19:09:42 +02:00
Nikolas Klauser 2d52c6bfae [libc++] Granularize __tuple
Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D133081
2022-09-05 16:36:24 +02:00
Nikolas Klauser e0b3356e67 [libc++] Enable rvalue overloads for pair in C++03
We require rvalue support anyways, so let's use it.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D133013
2022-09-05 14:40:17 +02:00
Nikolas Klauser d5e26775d0 [libc++] Granularize the rest of memory
Reviewed By: ldionne, #libc

Spies: vitalybuka, paulkirth, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D132790
2022-09-05 12:36:41 +02:00
Igor Zhukov 30dadaa2eb [libc++] Implement P2273R3 (`constexpr` `unique_ptr`)
Reviewed By: mordante, #libc

Differential Revision: https://reviews.llvm.org/D131315
2022-09-03 18:49:50 +07:00
Mark de Wever 4004fb6453 [NFC][libc++] Uses the new way to mark Standard includes. 2022-09-03 13:35:48 +02:00
Mark de Wever 49c3c40cc0 [NFC][libc++][format] Removes unused code.
The code was for backwards compatibility with code no longer present in
format.
2022-09-03 13:34:14 +02:00
Mark de Wever 56065c4c8e [NFC][libc++] Removes GCC-11 support.
GCC-11 isn't supported in libc++ so remove UNSUPPORTED directives.
2022-09-03 13:20:10 +02:00
Mark de Wever ba6ad62081 [libc++] Fixes generated output CI job.
It seems there was another file with the same issue, which didn't show
up initially.
2022-09-03 10:19:35 +02:00
Mark de Wever e31c2a1b1a [NFC][libc++] Moves transitive includes location.
As discussed in D132284 they will be moved to the end.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D133212
2022-09-03 10:06:16 +02:00
Mark de Wever ff06c2ded3 [libc++] Fixes generated output CI job. 2022-09-03 10:04:44 +02:00
Vitaly Buka bc8fd9c633 Revert "[libc++] Granularize the rest of memory"
Breaks buildbots.

This reverts commit 30adaa730c.
2022-09-02 19:42:49 -07:00
Igor Zhukov 3a49cffe3a [libc++] Implement P2445R1 (`std::forward_like`)
Co-authored-by: A. Jiang <de34@live.cn>

Reviewed By: philnik, huixie90, #libc

Differential Revision: https://reviews.llvm.org/D132327
2022-09-03 09:17:53 +07:00
Nikolas Klauser c747bd0e23 [libc++][NFC] Copy the whole union instead of a member; also remove __zero()
This doesn't affect code-gen

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132951
2022-09-02 21:44:57 +02:00
Nikolas Klauser 30adaa730c [libc++] Granularize the rest of memory
Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D132790
2022-09-02 21:42:41 +02:00
Nikolas Klauser cac9a6fb0e [libc++] Remove noexcept specifier from operator""s
For some reason `operator""s(const char8_t*, size_t)` was marked `noexcept`. Remove it and add regression tests.

Reviewed By: ldionne, huixie90, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132340
2022-09-02 21:37:32 +02:00
Nikolas Klauser 84fc2c3cd6 [libc++] Make the naming of private member variables consistent and enforce it through readability-identifier-naming
Reviewed By: ldionne, #libc

Spies: aheejin, sstefan1, libcxx-commits

Differential Revision: https://reviews.llvm.org/D129386
2022-09-02 21:36:36 +02:00
Nikolas Klauser 3c355e2881 [libc++] Enable [[nodiscard]] extensions by default
Adding `[[nodiscard]]` to functions is a conforming extension and done extensively in the MSVC STL.

Reviewed By: ldionne, EricWF, #libc

Spies: #libc_vendors, cjdb, mgrang, jloser, libcxx-commits

Differential Revision: https://reviews.llvm.org/D128267
2022-09-02 21:34:20 +02:00
Mark de Wever 9185d6e6bc [libc++] Avoids self references in transitive include test.
The output of --trace-includes starts with the header whose includes are
being processed. Since the sanitize script processed all lines this
include was added to the list of transitive includes. This looks odd
since it implies all headers have a cyclic dependency on themselves.
This change removes this self-include.

Instead of just dropping the first line extract that header and use it
to guard against cyclic dependencies in the header itself.

The regex used has a small improvement; don't capture groups that aren't
extracted.

Depends on D132284

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D132787
2022-09-01 20:33:37 +02:00
Mark de Wever 2928b230ce [NFC][libc++] char_traits code cleanups.
These cleanups were identified while working on D130295.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D131185
2022-08-31 22:18:10 +02:00
Mark de Wever 37c98da395 [libc++][format] Fixes broken CI.
Some of the merged patches didn't have conflicts but were not
compatible. This should fix it.
2022-08-31 20:14:10 +02:00
Mark de Wever 8ff2d6af69 [libc++] Reduces the number of transitive includes.
This defines a new policy for removal of transitive includes.
The goal of the policy it to make it relatively easy to remove
headers when needed, but avoid breaking developers using and
vendors shipping libc++.

The method used is to guard transitive includes based on the
C++ language version. For the upcoming C++23 we can remove
headers when we want, but for other language versions we try
to keep it to a minimum.

In this code the transitive include of `<chrono>` is removed
since D128577 introduces a header cycle between `<format>`
and `<chrono>`. This cycle is indirectly required by the
Standard. Our cycle dependency tool basically is a grep based
tool, so it needs some hints to ignore cycles. With the input
of our transitive include tests we can create a better tool.
However that's out of the scope of this patch.

Note the flag `_LIBCPP_REMOVE_TRANSITIVE_INCLUDES` remains
unchanged. So users can still opt-out of transitives includes
entirely.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D132284
2022-08-31 19:50:03 +02:00
Mark de Wever f92c733cc2 [libc++][format] Fixes floating-point formatting.
Formatting the alternate form for the general categories should keep the
trailing zeros. This was reported by @fsb4000 in D131336.

The default format uses general formatting but this should not keep the
trailing zeros so the default format is not passed to the formatter.

While testing I found an off by one error; finding the exponent character
`e` in 1e+03 will start at after the `1` so a size of `4` can contain an
exponent.

Reviewed By: fsb4000, ldionne, #libc

Differential Revision: https://reviews.llvm.org/D131417
2022-08-31 19:25:53 +02:00
Mark de Wever a595fcf9b4 [NFC][libc++][format] Renames __char_type concept.
Move the concept to the concepts header and uses a name in the style of
P2286.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D131176
2022-08-31 19:21:01 +02:00
Mark de Wever 36e0e2c485 [libc++][format] Allows width arg-id with value 0.
Implements:
- LWG3721 Allow an arg-id with a value of zero for width in std-format-spec

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D130649
2022-08-31 19:19:13 +02:00
Mark de Wever 87dd8c7289 [libc++][CI] increases constexpr evaluation limit.
This was discovered as an issue in D131317.

Depends on D131835

Reviewed By: #libc, var-const, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D131836
2022-08-31 19:16:40 +02:00
Mark de Wever 722ee9049d [libc++] Tests transitive includes for all C++03.
A followup of D132534 with C++03 enabled after fixing the experimental
PMR issues.

Depends on D132582

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D132584
2022-08-31 19:16:01 +02:00
Mark de Wever 982287a29b [libc++][experimental] Disables PMR in C++03.
While working on D132534 it appeared the experimental PMR code doesn't
have version guards and fails to compile on C++03. This adds the guards
for that version. It seems the tests already were only disabled for
C++03.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D132582
2022-08-31 19:15:36 +02:00
Mark de Wever 308a5b1a32 [libc++] Inlines format_error for clang-cl DLL.
This version is build without support for the experimental library but
the code still wants to link this function. Inlining the function solves
the issue.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D132667
2022-08-31 19:13:19 +02:00
Muiez Ahmed e1e9961f76 [SystemZ][z/OS] Account for renamed parameter name (libc++)
The following patch (https://reviews.llvm.org/D129051) broke z/OS builds by renaming the parameter name. This patch accounts for that change.

Differential Revision: https://reviews.llvm.org/D132946
2022-08-30 14:18:44 -04:00
Mark de Wever a72f6b032c [libc++] Improves feature-test macro diagnostics.
This was mentioned in review D131326.

Reviewed By: var-const, #libc, philnik

Differential Revision: https://reviews.llvm.org/D132293
2022-08-30 17:56:35 +02:00
Matheus Izvekov 3012a0c373
[libcxx] CI: set symbolizer for bootstrapping build
Setting the symbolizer is required for getting a pretty
stack trace when Clang crashes.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D132807
2022-08-30 15:00:41 +02:00
Martin Storsjö 8e29e379b0 [libcxx] [test] Remove an unnecessary condition in a feature check
We don't need to check for `_LIBCPP_HAS_NO_LOCALIZATION` here;
this was copied over by mistake from the test above (which does
use locale.h).

Differential Revision: https://reviews.llvm.org/D132834
2022-08-30 10:06:52 +03:00
Mark de Wever a6ce0d087a [NFC][libc++][format] Use ranges in the output.
This should avoid some copies of the output iterator.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D132812
2022-08-29 18:13:30 +02:00
Nikolas Klauser 640e2bae50 [libc++] Mark everything in <deque> as _LIBCPP_HIDE_FROM_ABI and replace _LIBCPP_INLINE_VISIBILITY
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132320
2022-08-27 22:01:00 +02:00
Mark de Wever ca04b49597 [libc++][CI] Increases the Clang version used.
Changes the CI to use the Clang 16 nightly builds instead of Clang 14.
(The libc++15 branch was accidentally build using Clang 14 instead of
Clang 15; hence the skipping of a number.)

Also adds a Clang 15 build to the test matrix.

Based on the private discussion with @ldionne we decided to move
the configuration parameters from the `run-buildbot` script to the
CI configuration `buildkite-pipeline.yml`. Other hard-coded values
from the Dockerfile should be move to the CI configuration too. That
will be done in another commit.

C++17 will use Clang-15 since D131479 causes a test to fail.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D131174
2022-08-27 13:42:38 +02:00
Nikolas Klauser a13822b35d [libc++] Simplify type_traits a bit more
Reviewed By: ldionne, #libc

Spies: STL_MSFT, CaseyCarter, huixie90, libcxx-commits

Differential Revision: https://reviews.llvm.org/D129094
2022-08-27 10:19:11 +02:00
Nikolas Klauser 59d246e55f [libc++] Remove __deque_base
This patch simplifies the implementation of `deque` by removing the `__deque_base` class which results in a lot less indirections and removes the need for `__base::`.

Reviewed By: ldionne, #libc

Spies: AdvenamTacet, libcxx-commits

Differential Revision: https://reviews.llvm.org/D132081
2022-08-26 21:59:33 +02:00
Nikolas Klauser 786366b18f [libc++][NFC] Remove some of the code duplication in the string tests
Reviewed By: ldionne, #libc, huixie90

Spies: huixie90, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D131856
2022-08-26 21:57:42 +02:00
Nikolas Klauser 98f6a56f5e [libc++] Enable hash only for the correct types
Also implement LWG3705.
Fixes https://github.com/llvm/llvm-project/issues/55823

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132338
2022-08-26 17:40:23 +02:00
Nikolas Klauser 56e1f0f056 [libc++][NFC] Remove reserved names from support/constexpr_char_traits.h
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132341
2022-08-26 17:37:47 +02:00
Joe Loser eb1ceb17ae [libc++][test] Use TEST_HAS_NO_CHAR8_T to simplify #ifdefs. NFCI.
Many tests in `libcxx/test/std/strings` use
`#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L`
which can be replaced with the more terse `#ifndef TEST_HAS_NO_CHAR8_T`.

Differential Revision: https://reviews.llvm.org/D132626
2022-08-25 21:09:10 -06:00