Commit Graph

4572 Commits

Author SHA1 Message Date
Dan Albert
73660f725a Stop using __strtonum_fallback on Android.
Fallback implementations are now provided by bionic when necessary,
which these may conflict with.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324534 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 21:58:48 +00:00
Marshall Clow
088e6015b2 Fix PR#31454 - 'basic_string<T>::push_back() crashes if sizeof(T)>sizeof(long long)'. We were mishandling the small-string optimization calculations for very large 'characters'. This may be an ABI change (change the size of) strings of very large 'characters', but since they never worked, I'm not too concerned.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324531 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 21:30:17 +00:00
Eric Fiselier
2e1fa09f68 Fix -verify static assert messages for older Clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324529 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 21:25:25 +00:00
Eric Fiselier
6cb35ede81 [libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default constructible types.
Summary:
This patch fixes llvm.org/PR35491 and LWG2157  (https://cplusplus.github.io/LWG/issue2157)

The fix attempts to maintain ABI compatibility by replacing the array with a instance of `aligned_storage`.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: lichray, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324526 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 21:06:13 +00:00
Marshall Clow
f003d63c40 Comment on 'Review' issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324503 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 19:24:37 +00:00
Marshall Clow
31810d9c0b Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324423 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 23:13:48 +00:00
Marshall Clow
c387931db5 Mark P0777 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 21:00:58 +00:00
Marshall Clow
52f9ca28a3 Implement P0777: Treating unnecessay decay
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324398 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 20:56:55 +00:00
Nico Weber
68b20ca4d9 Fix building libc++ with the macOS 10.13 SDK with -mmacosx-version-min=10.12 or lower.
The 10.13 SDK always defines utimensat() (with an availability(macosx=10.13) annotation)
and unconditionally defines UTIME_OMIT, so use the compile-time availability macros
on Apple platforms instead.

For people statically linking libc++, it might make sense to also provide an opt-in
option for using __builtin_available() to dynamically check for the OS version,
but for now let's do the smallest thing needed to unbreak the build.

Based on a patch by Eric Fiselier <eric@efcs.ca>: https://reviews.llvm.org/D34249
Fixes PR33469.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324385 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 19:17:41 +00:00
Marshall Clow
f477af5fda Fix misleading indentation; replace a couple of NULLs with nullptr. Resolves https://reviews.llvm.org/D42945 ; thanks to Bruce Mitchener for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324378 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 18:58:05 +00:00
Marshall Clow
46c8ec503e No, really this time mark 3034 as 'Patch Ready'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324312 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 03:24:21 +00:00
Marshall Clow
4d839cb37e Mark issue 3034 as 'Patch Ready'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324310 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 03:23:16 +00:00
Nirav Dave
610fc67809 Revert "[libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default constructible types."
Revert "Fix initialization of array<const T, 0> with GCC."
Revert "Make array<const T, 0> non-CopyAssignable and make swap and fill ill-formed."

This reverts commit r324182, r324185, and r324194 which were causing issues with zero-length std::arrays.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324309 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 03:03:37 +00:00
Marshall Clow
6c83c7ff6f More patches ready
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324307 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 01:59:28 +00:00
Marshall Clow
53095c7200 Add issues in 'Review'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324292 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-05 23:50:49 +00:00
Marshall Clow
b50d2443d5 Remove <experimental/string_view>; use <string_view> instead. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324290 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-05 23:43:34 +00:00
Eric Fiselier
13177172d0 Fix initialization of array<const T, 0> with GCC.
Previously, when handling zero-sized array of const objects we
used a const version of aligned_storage_t, which is not an array type.
However, GCC complains about initialization of the form: array<const T, 0> arr = {};

This patch fixes that bug by making the dummy object used to represent
the zero-sized array an array itself. This avoids GCC's complaints
about the uninitialized const member.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 08:02:35 +00:00
Eric Fiselier
88232b14d4 Mark LWG 3014 as complete. No code changes needed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324193 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:37:09 +00:00
Eric Fiselier
4d0f42850b Implement LWG 3014 - Fix more noexcept issues in filesystem.
This patch removes the noexcept declaration from filesystem
operations which require creating temporary paths or
creating a directory iterator. Either of these operations
can throw.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324192 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:35:36 +00:00
Eric Fiselier
b2c07b0af2 Mark LWG 3013 as already complete. See r316941
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324191 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:29:53 +00:00
Eric Fiselier
9611902923 Remove debug println from rec.dir.itr.increment test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324190 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 03:26:55 +00:00
Eric Fiselier
0b47a655ac Implement LWG2989: path's streaming operators allow everything under the sun.
Because path can be constructed from a ton of different types, including string
and wide strings, this caused it's streaming operators to suck up all sorts
of silly types via silly conversions. For example:

using namespace std::experimental::filesystem::v1;
std::wstring w(L"wide");
std::cout << w; // converts to path.

This patch tentatively adopts the resolution to LWG2989 and fixes the issue
by making the streaming operators friends of path.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324189 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 03:10:53 +00:00
Eric Fiselier
cc7688a719 Mark issue 2851 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324188 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 02:45:33 +00:00
Eric Fiselier
af1fd7c75f Address LWG 2849 and fix missing failure condition in copy_file.
Previously copy_file didn't handle the case where the input and
output were the same file.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 02:43:32 +00:00
Eric Fiselier
7d251c57ac correct comment about C++03 assignment operators
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324186 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 02:22:33 +00:00
Eric Fiselier
122c064a76 Make array<const T, 0> non-CopyAssignable and make swap and fill ill-formed.
The standard isn't exactly clear how std::array should handle zero-sized arrays
with const element types. In particular W.R.T. copy assignment, swap, and fill.

This patch takes the position that those operations should be ill-formed,
and makes changes to libc++ to make it so.

This follows up on commit r324182.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324185 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 02:17:02 +00:00
Eric Fiselier
f3224ac007 [libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default constructible types.
Summary:
This patch fixes llvm.org/PR35491 and LWG2157  (https://cplusplus.github.io/LWG/issue2157)

The fix attempts to maintain ABI compatibility by replacing the array with a instance of `aligned_storage`.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: lichray, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324182 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 01:03:08 +00:00
Eric Fiselier
b173b26b9e Work around GCC constexpr initialization bug
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324165 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-03 01:48:21 +00:00
Eric Fiselier
b232793189 Work around Clang bug introduced in r324062
When Clang encounters an already invalid class declaration, it can
emit incorrect diagnostics about the exception specification on
some of its members. This patch temporarily works around that
incorrect diagnostic.

The clang bug was introduced in r324062.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324164 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-03 01:45:35 +00:00
Eric Fiselier
d33aaa939c Fix has_unique_object_representation after Clang commit r324134.
Clang previously reported an empty union as having a unique object
representation. This was incorrect and was fixed in a recent Clang commit.

This patch fixes the libc++ tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324153 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-02 22:39:59 +00:00
Richard Smith
b2189c01fa Disable test in C++<11 mode due to use of alignas.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324033 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 23:31:22 +00:00
Richard Smith
dfb1351077 Make std::get_temporary_buffer respect overaligned types when possible
Patch by Chris Kennelly!

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324020 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 22:24:45 +00:00
Marshall Clow
fd34566e5a Put the exception classes for experimental::optional and experimental::any back in the dylib for binary compatibility
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 18:45:57 +00:00
Marshall Clow
b21316f66c Remove std::experimental::sample; use std::sample instead. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323979 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 16:36:08 +00:00
Marshall Clow
14698bce22 Remove <experimental/numeric>; use <numeric> instead. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323975 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 15:49:27 +00:00
Marshall Clow
f8d223fe63 Remove <experimental/any>; use <any> instead. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323972 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 15:21:14 +00:00
Marshall Clow
95db3d2871 Remove <experimental/optional>; use <optional> instead. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323971 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 14:54:25 +00:00
Marshall Clow
75075c6be0 Add static_asserts to basic_ios and basic_stream_buf to ensure that that the traits match the character type. This is a requirement on the user - now we get consistent failures at compile time instead of incomprehensible error messages or runtime failures. This is also LWG#2994 - not yet adopted.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323945 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 03:55:27 +00:00
Marshall Clow
37e4c9b159 Implement LWG2870: Default value of parameter theta of polar should be dependent
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323918 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-31 21:42:39 +00:00
Marshall Clow
65c4c248c2 Add LWG3051
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323822 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 21:49:17 +00:00
Marshall Clow
64aa1c1b75 First cut at issue statuses for JAX
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323720 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 00:48:39 +00:00
Marshall Clow
4bbcce7ef8 Add tests to make sure that <string_view> provides std::size/data/empty in C++17 mode. This is LWG#3009, coming up for a vote in JAX - but we already do it, just don't have tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323719 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 00:47:43 +00:00
Marshall Clow
6f79a901d1 Minor updated to the main libcxx page; add a link to the deprecation page
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323694 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 21:28:46 +00:00
Don Hinton
1dfee5b4d4 LLVM_FOUND isn't always set, so just test if llvm_setup_rpath() is
available instead.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-27 18:55:30 +00:00
Peter Collingbourne
27c341db41 Fix the BinaryPredicate form of std::is_permutation to not rely on operator==
According to [1], forms 2 and 4 of std::is_permutation should use the passed in
binary predicate to compare elements. operator== should only be used for forms
1 and 3 which do not take a binary predicate.

This CL fixes forms 2 and 4 which relied on operator== for some comparisons.

[1] http://en.cppreference.com/w/cpp/algorithm/is_permutation

Patch by Thomas Anderson!

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323563 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 21:23:27 +00:00
Don Hinton
44aacb7850 Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323492 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 01:34:51 +00:00
Peter Collingbourne
2b64fcb946 libcxx: Use vcruntime declarations for typeinfo on Windows.
We need to use the vcruntime declarations on Windows to avoid an
ODR violation involving rtti.obj, which provides the definition of
the runtime function implementing dynamic_cast and depends on the
vcruntime implementations of bad_cast and bad_typeid.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323491 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 01:22:17 +00:00
Peter Collingbourne
6b5c08ab34 libcxx: Move #include_next <math.h> out of header guard in wrapper header.
Code on Windows expects to be able to do:

 #define _USE_MATH_DEFINES
 #include <math.h>

and receive the definitions of mathematical constants, even if <math.h>
has previously been included. To support this scenario, re-include
<math.h> every time the wrapper header is included.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323490 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 01:19:23 +00:00
Marshall Clow
e686a8dec0 Mark 2903 as complete; we already do this
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323479 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-25 22:33:17 +00:00
Don Hinton
e0c8dbec38 Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
Shoaib Meenai pointed out this will break standalone builds when built without llvm.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323459 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-25 19:22:23 +00:00