Commit Graph

5934 Commits

Author SHA1 Message Date
Lubos Dolezel
f1d9f7bb21 Merge remote-tracking branch 'upstream/master' into HEAD 2020-04-17 14:51:11 +02:00
Zoe Carver
78d6a7767e [libcxx] Remove shared_ptr::make_shared
Summary: This patch removes `shared_ptr::make_shared` as it is not part of the standard. This patch also adds __create_with_cntrl_block, which is a help function that can be used in std::allocate_shared and std::make_shared. This is the third patch (out of 4) from D66178.

    Reviewers: EricWF, mclow.lists, ldionne

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D68805

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375504 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-22 15:16:49 +00:00
Louis Dionne
4dff356569 [NFC] Fix typos in CMake comment
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375469 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-21 23:38:32 +00:00
Dimitry Andric
41e7283b76 Refine check for _LIBCPP_C_HAS_NO_GETS on FreeBSD
Summary:
In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library
does not provide `gets()`, and added a test for FreeBSD 13 or higher,
using the compiler-defined `__FreeBSD__` macro.

Unfortunately this did not work that well for FreeBSD's own CI process,
since the gcc compilers used for some architectures define `__FreeBSD__`
to match the build host, not the target.

Instead, we should use the `__FreeBSD_version` macro from the userland
header `<osreldate.h>`, which is more fine-grained.  See also
<https://reviews.freebsd.org/D22034>.

Reviewers: EricWF, mclow.lists, emaste, ldionne

Reviewed By: emaste, ldionne

Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D69174

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375340 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-19 10:59:23 +00:00
Richard Smith
7e5c56366a P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.
Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings.

Reviewers: mclow.lists, EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D68879

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375307 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-19 00:06:00 +00:00
Casey Carter
fb944628a6 [libc++][test] Use <version> to get config on MSVC
...instead of `<ciso646>`.

Also includes some NFC comment changes.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374854 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 00:22:38 +00:00
Casey Carter
5f31123bc7 [libc++][test] Portability fix for std::any tests
Ensure that `large_tracked_t` defined in `any_helpers.h` is in fact too large to fit in `std::any`'s small object buffer.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374806 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 19:05:04 +00:00
Casey Carter
cb623673dc [libc++][test] Add license headers to test/support/archetypes.*
Differential Revision: https://reviews.llvm.org/D68947

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374797 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 18:00:34 +00:00
Casey Carter
4fd9329d34 [libc++][test] Silence more warnings in variant tests
More cases of signed-to-unsigned conversion warnings that missed the train for d2623522.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374778 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:38:12 +00:00
Casey Carter
79d2a7134b [libc++][test] std::variant test cleanup
* Add the conventional `return 0` to `main` in `variant.assign/conv.pass.cpp` and `variant.ctor/conv.pass.cpp`

* Fix some MSVC signed-to-unsigned conversion warnings by replacing `int` literarls with `unsigned int` literals

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374723 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 16:46:16 +00:00
Casey Carter
6dc4120468 [libc++][test] <=> now has a feature-test macro
...which `test/support/test_macros.h` can use to detect compiler support.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374722 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 16:46:12 +00:00
Casey Carter
1f4cad9f28 [libc++][test] Silence MSVC warning in std::optional test
`make_optional<string>(4, 'X')` passes `4` (an `int`) as the first argument to `string`'s `(size_t, charT)` constructor, triggering a signed/unsigned mismatch warning when compiling with MSVC at `/W4`. The incredibly simple fix is to instead use an unsigned literal (`4u`).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374684 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-12 19:01:46 +00:00
Petr Hosek
437d5a5dcf [libc++] Fix linker script generation
Handle the case when libc++abi and libunwind are being built together
with libc++ in the runtimes build. This logic was used in the previous
implementation but dropped in r374116.

Differential Revision: https://reviews.llvm.org/D68791

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374510 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-11 04:54:35 +00:00
Casey Carter
dda1e448f9 [libc++][test] Change IsSmallObject's calculation for std::any's small object buffer
`sizeof(std::any) - sizeof(void*)` is correct for both libc++ and the MSVC standard library.

Differential Revision: https://reviews.llvm.org/D68756

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374407 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10 18:07:12 +00:00
Casey Carter
193f1880bd [libc++][test] Miscellaneous MSVC cleanups
* Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++.
* Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`.
* Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined.
* Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings.
* Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating.

Differential Revision: https://reviews.llvm.org/D68681

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 22:19:17 +00:00
Eric Fiselier
da6e915c73 Optimize operator=(const basic_string&) for tail call.
Patch by Martijn Vels (mvels@google.com)
Reviewed as https://reviews.llvm.org/D68276

This is a non trivial win for externally templated assignment operator.

x86 without tail call (current libc++)

0000000000000000 <std::string::operator=(std::string const&)>:
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   53                      push   %rbx
   5:   50                      push   %rax
   6:   48 89 fb                mov    %rdi,%rbx
   9:   48 39 f7                cmp    %rsi,%rdi
   c:   74 17                   je     25 <std::string::operator=(std::string const&)+0x25>
   e:   0f b6 56 17             movzbl 0x17(%rsi),%edx
  12:   84 d2                   test   %dl,%dl
  14:   79 07                   jns    1d <std::string::operator=(std::string const&)+0x1d>
  16:   48 8b 56 08             mov    0x8(%rsi),%rdx
  1a:   48 8b 36                mov    (%rsi),%rsi
  1d:   48 89 df                mov    %rbx,%rdi
  20:   e8 00 00 00 00          callq  25 <std::string::operator=(std::string const&)+0x25>
  25:   48 89 d8                mov    %rbx,%rax
  28:   48 83 c4 08             add    $0x8,%rsp
  2c:   5b                      pop    %rbx
  2d:   5d                      pop    %rbp
  2e:   c3                      retq

After:

0000000000000000 <std::string::operator=(std::string const&)>:
   0:   48 39 f7                cmp    %rsi,%rdi
   3:   74 14                   je     19 <std::string::operator=(std::string const&)+0x19>
   5:   0f b6 56 17             movzbl 0x17(%rsi),%edx
   9:   84 d2                   test   %dl,%dl
   b:   79 07                   jns    14 <std::string::operator=(std::string const&)+0x14>
   d:   48 8b 56 08             mov    0x8(%rsi),%rdx
  11:   48 8b 36                mov    (%rsi),%rsi
  14:   e9 00 00 00 00          jmpq   19 <std::string::operator=(std::string const&)+0x19>
  19:   48 89 f8                mov    %rdi,%rax
  1c:   c3                      retq

Benchmark (pending per https://reviews.llvm.org/D67667)

```
BM_StringAssignStr_Empty_Opaque                     6.23ns ± 0%             5.19ns ± 0%  -16.70%          (p=0.016 n=5+4)
BM_StringAssignStr_Empty_Transparent                5.86ns ± 0%             5.14ns ± 0%  -12.24%          (p=0.008 n=5+5)
BM_StringAssignStr_Small_Opaque                     8.79ns ± 1%             7.69ns ± 0%  -12.53%          (p=0.008 n=5+5)
BM_StringAssignStr_Small_Transparent                9.44ns ± 0%             8.00ns ± 0%  -15.26%          (p=0.008 n=5+5)
BM_StringAssignStr_Large_Opaque                     25.2ns ± 0%             24.3ns ± 0%   -3.50%          (p=0.008 n=5+5)
BM_StringAssignStr_Large_Transparent                23.6ns ± 0%             22.5ns ± 0%   -4.76%          (p=0.008 n=5+5)
BM_StringAssignStr_Huge_Opaque                       319ns ± 5%              317ns ± 5%     ~             (p=0.690 n=5+5)
BM_StringAssignStr_Huge_Transparent                  319ns ± 5%              317ns ± 5%     ~             (p=0.421 n=5+5)
BM_StringAssignAsciiz_Empty_Opaque                  7.41ns ± 0%             7.77ns ± 0%   +4.89%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Empty_Transparent             7.54ns ± 3%             7.30ns ± 0%   -3.24%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Small_Opaque                  9.87ns ± 0%            10.24ns ± 1%   +3.76%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Small_Transparent             10.4ns ± 1%              9.8ns ± 2%   -5.78%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Large_Opaque                  30.1ns ± 0%             30.1ns ± 0%     ~             (p=0.167 n=5+5)
BM_StringAssignAsciiz_Large_Transparent             27.1ns ± 0%             27.4ns ± 0%   +0.92%          (p=0.016 n=4+5)
BM_StringAssignAsciiz_Huge_Opaque                    383ns ± 4%              382ns ± 4%     ~             (p=0.548 n=5+5)
BM_StringAssignAsciiz_Huge_Transparent               375ns ± 0%              380ns ± 0%   +1.37%          (p=0.029 n=4+4)
BM_StringAssignAsciizMix_Opaque                     14.0ns ± 0%             14.0ns ± 0%     ~             (p=0.881 n=5+5)
BM_StringAssignAsciizMix_Transparent                13.7ns ± 1%             13.8ns ± 0%     ~             (p=0.056 n=5+5)
```

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374137 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 03:07:02 +00:00
Louis Dionne
76ba5dd1db [libc++] Workaround old versions of CMake that don't understand list(JOIN)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374120 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 21:33:35 +00:00
Louis Dionne
ef2d23967e [libc++] Move the linker script generation step to CMake
Summary:
This allows the linker script generation to query CMake properties
(specifically the dependencies of libc++.so) instead of having to
carry these dependencies around manually in global variables. Notice
the removal of the LIBCXX_INTERFACE_LIBRARIES global variable.

Reviewers: phosek, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D68343

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 21:10:20 +00:00
Louis Dionne
d265021834 [libc++] Make sure we link all system libraries into the benchmarks
It turns out that r374056 broke _some_ build bots again, specifically
the ones using sanitizers. Instead of trying to link the right system
libraries to the benchmarks bit-by-bit, let's just link exactly the
system libraries that libc++ itself needs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374079 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 16:26:24 +00:00
Louis Dionne
2a88a04e08 [libc++] TAKE 2: Make system libraries PRIVATE dependencies of libc++
We tried doing that previously (in r373487) and failed (reverted in
r373506) because the benchmarks needed to link against system libraries
and relied on libc++'s dependencies being propagated. Now that this has
been fixed (in r374053), this commit marks the system libraries as
PRIVATE dependencies of libc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374056 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 14:53:11 +00:00
Louis Dionne
caa8e2ccef [libc++] Add missing link-time dependencies to the benchmarks
Since the benchmarks build with -nostdlib, they need to manually link
against some system libraries that are used by the benchmarks and the
GoogleBenchmark library itself.

Previously, we'd rely on the fact that these libraries were linked
through the PUBLIC dependencies of cxx_shared/cxx_static. However,
if we were to make these dependencies PRIVATE (as they should be
because they are implementation details of libc++), the benchmarks
would fail to link. This commit remediates that.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 14:28:56 +00:00
Louis Dionne
c7883618be [libc++] Use PRIVATE to link benchmark dependencies
It's better style to use PRIVATE when linking libraries to executables,
and it doesn't make a difference since executables don't need to propagate
their link-time dependencies anyway.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374050 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 14:10:55 +00:00
Zoe Carver
f372cc7e82 [libc++] Remove C++03 variadics in shared_ptr (v2)
Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics.

    Reviewers: ldionne, EricWF, mclow.lists

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D68000

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373971 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-07 21:41:15 +00:00
Alex Langford
346d6e294c [libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY
If you explicitly set LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY to OFF, your
project will fail to configure because the cxx_experimental target
doesn't exist.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373809 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 23:08:20 +00:00
Louis Dionne
2f7d67c8fc [libc++] Localize common build flags into a single CMake function
Also, set those flags for the cxx_experimental target. Otherwise,
cxx_experimental doesn't build properly when neither the static nor
the shared library is compiled (yes, that is a weird setup).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373808 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 22:50:23 +00:00
Sterling Augustine
09d641ffc2 Add an off-by-default option to enable testing for gdb pretty printers.
Summary:
The current version of the pretty printers are not python3 compatible,
so turn them off by default until sufficiently improved.

Reviewers: MaskRay, tamur

Subscribers: mgorny, christof, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68477

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 22:15:28 +00:00
Louis Dionne
2f59751955 [libc++] Make the modules-related flags PUBLIC instead of PRIVATE
It appears that those need to be propagated to targets that use libc++
as well, otherwise they don't build properly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373773 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 19:10:56 +00:00
Louis Dionne
c1da965864 [libc++] Move more CMake flags to per-target definitions
This daily refactoring tackles flags related to modules,
exceptions and RTTI.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 18:03:17 +00:00
Fangrui Song
2b539adf22 Make libc++ gdb pretty printer Python 3 compatible
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373691 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 04:47:33 +00:00
Eric Fiselier
0d7477f78f Attempt to remove linker workaround on the buildbots: Attempt 2
The first commit removed the workaround in a old script.
This patch removes it in the file actually used by the bots.

I have no idea if this is still needed, but removing the
workaround seems like the easiest way to test.

I'll revert this change if the bots go red.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373653 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 19:38:44 +00:00
Eric Fiselier
9dce2def7e Attempt to remove linker workaround on the buildbots.
I have no idea if this is still needed, but removing the
workaround seems like the easiest way to test.

I'll revert this change if the bots go red.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373650 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 19:13:35 +00:00
Louis Dionne
8937697dbc [libc++] Add a per-target flag to include the generated config_site
This allows propagating the include automatically to targets that
depend on one of the libc++ targets such as the benchmarks. Note
that the GoogleBenchmark build itself still needs to manually specify
the -include, since I don't know of any way to have an external project
link against one of the libc++ targets (which would propagate the -include
automatically).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373631 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 17:20:50 +00:00
Louis Dionne
d3253a749c [libc++] Add missing revision number in ABI changelog
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373625 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 16:50:05 +00:00
Fangrui Song
11a6f223fb Fix libc++ pretty printer test for Python 3 after D67238 (take 2)
In both Python 2 and Python 3, gdb.Value.string returns a 'str'. We just
need to delete a `encode("utf-8")` which would return a 'bytes' in
Python 3.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373570 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 06:19:50 +00:00
Louis Dionne
48a15a7b3a [libc++] Use functions instead of global variables to set libc++ build flags
This commit follows the trend of doing things per-target instead of
modifying the C++ flags globally. It does so for visibility-related
flags, other basic build flags and Windows-specific flags.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373517 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 20:07:01 +00:00
Louis Dionne
6035dc6838 [libc++] Use a function to set warning flags per target
This is part of a larger shift to move to per-target settings and
eradicate global variables from the CMake build. I'm starting small
with warnings only because those are easy to transition over and I
want to see how it pans out, but we can handle all flags like exceptions
and RTTI in the future.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373511 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 19:31:30 +00:00
Louis Dionne
632d80c6f2 [libc++] Revert to using PUBLIC instead of PRIVATE when linking system libs
It turns out the benchmarks need to link against those libraries
explicitly too, so CMake's propagation of PUBLIC dependencies is
used.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373506 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 19:11:08 +00:00
Louis Dionne
9ab4f358d7 [libc++] Use PRIVATE instead of PUBLIC when linking against system libs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373487 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 16:51:42 +00:00
Fangrui Song
d81b9578e5 Fix libc++ pretty printer test for Python 3 after D67238
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373452 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 11:49:47 +00:00
Sterling Augustine
2518823f1d Determine endianness at a time when it doesn't inadvertantly clear gdb's wrap_buffer via gdb.execute.
Summary:
I haven't managed a small reproduction for this bug, it involves
complicated and deeply nested data structures with a wide variety
of pretty printers. But in general, we shouldn't be combining
gdb's command line interface (via gdb.execute) with pretty-printers.

Subscribers: christof, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68306

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373402 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 22:42:37 +00:00
Louis Dionne
af8e0992bb [NFC] Fix typos in libc++ documentation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373390 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 20:34:50 +00:00
Louis Dionne
a6f6da0dab [libc++] Re-apply workaround for D63883
In reality, this workaround is for the fact that LIBCXX_CXX_ABI=libcxxabi
can't be specified on Linux, since libc++abi isn't shipped with the system.
Since the build bots explicitly specify LIBCXX_CXX_ABI=libcxxabi, they fail
unless we apply the workaround.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373385 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 19:27:38 +00:00
Louis Dionne
bae77f132a [libc++] Remove workaround for D63883
I tried applying D63883 three times and could never get around to
making it work. I'm giving up on that for now, but soon this should
be irrelevant anyway since all builds will move to the monorepo
(where we're always using the in-tree libc++abi unless explicitly
specified otherwise).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373384 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 19:13:52 +00:00
Louis Dionne
cae4caafde [libc++] Harden usage of static_assert against C++03
In C++03, we emulate static_assert with a macro, and we must parenthesize
multiple arguments.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373328 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 12:12:21 +00:00
Eric Fiselier
8ef0e6a4fe Refactor default constructor SFINAE in pair and tuple.
Refactor the  recent implicit default constructor changes to match the
existing SFINAE style.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373263 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 20:55:30 +00:00
Louis Dionne
9637883af0 [libc++] Take 2: Implement LWG 3158
Summary:
LWG 3158 marks the allocator_arg_t constructor of std::tuple as
conditionnally explicit based on whether the default constructors
of the tuple's members are explicitly default constructible.

This was previously committed as r372778 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.

Reviewers: mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65232

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373092 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 15:06:52 +00:00
Louis Dionne
00f026a08c [libc++] Take 2: Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.

This was previously committed as r372777 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.

Reviewers: mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65161

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372983 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 14:51:10 +00:00
David Zarzycki
b0651b603e [libcxx] Do not implicitly #include assert.h
Users should only get the assert() macros if they explicitly include
them.

Found after switching from the GNU C++ stdlib to the LLVM C++ stdlib.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372963 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 11:12:29 +00:00
Louis Dionne
172204fa13 [libc++] Purge mentions of GCC 4 from the test suite
We don't support GCC 4 and older according to the documentation, so
we should pretend it doesn't exist.

This is a re-application of r372787.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372916 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 19:40:48 +00:00
Eric Fiselier
5265e271ed Add forward declaration of operator<< in <string_view> as required.
This declaration was previously missing despite appearing in the
synopsis. Users are still required to include <ostream> to get the
definition of the streaming operator.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372909 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 18:56:54 +00:00