Commit Graph

3106 Commits

Author SHA1 Message Date
Eric Fiselier
fc6e622f19 Add mork workarounds for running the test suite against libstdc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 00:28:14 +00:00
Eric Fiselier
53003593a2 Make it easier to run the libc++ test suite against libstdc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 00:00:37 +00:00
Eric Fiselier
508f208ae9 Fix LWG2683 - filesystem::copy() should always clear the user-provided error_code
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 22:18:09 +00:00
Marshall Clow
a75b75f514 Remove extraneous 'const' in the implementation of is_move_assignable. Howard pleads temporary insanity about this. Discussed at http://stackoverflow.com/questions/39986185
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 21:24:06 +00:00
Eric Fiselier
e2bd16c9d2 Fix std::pair on FreeBSD
Summary:
FreeBSD ships an old ABI for std::pair which requires that it have non-trivial copy/move constructors. Currently the non-trivial copy/move is achieved by providing explicit definitions of the constructors. This is problematic because it means the constructors don't SFINAE properly. In order to SFINAE copy/move constructors they have to be explicitly defaulted and hense non-trivial.

This patch attempts to provide SFINAE'ing copy/move constructors for std::pair while still making them non-trivial. It does this by adding a base class with a non-trivial copy constructor and then allowing pair's constructors to be generated by the compiler. This also allows the constructors to be constexpr.


Reviewers: emaste, theraven, rsmith, dim

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 21:22:21 +00:00
Eric Fiselier
05577c82e1 Fix incorrect exception handling behavior in the uninitialized algorithms
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 21:13:44 +00:00
Marshall Clow
9d97e2bc3f Mark 2777 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:37:16 +00:00
Marshall Clow
529c61f2dc Update with the rest of the results from the 7-Oct Telecom
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:00:12 +00:00
Petr Hosek
bf1f79c27a [libcxx] Add support for Fuchsia
Fuchsia is a new operating system which uses musl as the standard
C library, libc++ and libc++abi as the C++ standard library.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 18:53:32 +00:00
Marshall Clow
bcef974041 Updated notes about issues; marked 2062, 2223, 2394, 2460 and 2540 as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 17:11:37 +00:00
Marshall Clow
e9115a1b41 Add tests to check that swap(std::function, std::function) is noexcept. This is LWG#2062, but we already do this. No changes to the library, just adding tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:47:48 +00:00
Asiri Rathnayake
f7b867b342 [libcxx] Fix gcc build.
Attempt to fix a horrible gcc include order problem.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 15:56:01 +00:00
Eric Fiselier
742d878b02 Fix documentation mis-spelling.
I promise to stop misspelling things when the English language gains a program
that does strict semantic checking.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:45:06 +00:00
Marshall Clow
c3f1198253 Add whitespace to make not_fn_impl more clear. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:37:18 +00:00
Marshall Clow
2b6c2499b1 Mark issues 2544, 2567, 2569, 2686 and 2694 as ready/done.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:15:56 +00:00
Marshall Clow
8be2c5dd9e Add tests for LWG2544. We already implement this; just adding tests to make sure that we keep doing it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:10:45 +00:00
Asiri Rathnayake
8a486cec46 [libcxx] Add the missing limits.h header
The implementation of [depr.c.headers] in D12747 introduced the necessary
C headers into libc++. This patch adds one more missing headers: limits.h

We spotted this due to a failing C++03 test [limits_h.pass.cpp] in our libc++
configuration; when the limits.h header is included from a C++ program, it now
bypassed the __config header and went directly into the underlying C library's
limits.h header, which is problematic for us because we use __config header to
configure the underlying C library's behaviour when used from a C++ context.

Reviewers: mclow.lists, rsmith

Differential revision: https://reviews.llvm.org/D25361

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 08:38:51 +00:00
Eric Fiselier
a54229f7c5 Cleanup CMake status output
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 06:31:00 +00:00
Eric Fiselier
a244bb9d18 Provide a constexpr addressof with GCC 7.
__builtin_addressof was added to the GCC trunk in the past week. This patch
teaches libc++ about it so it can correctly provide constexpr addressof.

Unfortunately this patch will break users of earlier GCC 7 builds, since
we expect __builtin_addressof but one won't be provided. One option would be
to only use __builtin_addressof for GCC 7.1 and above, but that means
waiting for another release.

Instead I've specifically chosen to break older GCC 7 versions. Since GCC 7
has yet to be released, and the 7.0 release is a development release, I
believe that anybody currently using GCC 7.0 will have no issue upgrading.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 05:34:18 +00:00
Eric Fiselier
051593845d Workaround missing C++14 constexpr semantics in filesystem
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 05:19:59 +00:00
Eric Fiselier
fd0e761473 Remove use of int128_t inside the filesystem implementation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 04:22:58 +00:00
Eric Fiselier
8bddff75ef Remove debug output from gen_linker_script.py
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283701 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 21:43:30 +00:00
Eric Fiselier
3bf8a9cb67 Fix linker script generation for in-tree builds
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 21:34:03 +00:00
Hal Finkel
475cf02300 [CMake] Fix in-tree libcxxabi build support after r283659
r283659 changed the argument to gen_link_script.py from SCRIPT_ABI_LIBNAME to
LIBCXX_LIBRARIES_PUBLIC, assuming that all of the items in the
LIBCXX_LIBRARIES_PUBLIC list were library names. This is not right, however,
for in-tree libcxxabi builds, we might have the target name in this list. There
was special logic to fixup SCRIPT_ABI_LIBNAME for this situation; change it to
apply a similar fixup for LIBCXX_LIBRARIES_PUBLIC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-09 02:49:31 +00:00
Michal Gorny
ffac2247af [cmake] Split linked libraries into private & public, for linker script
Introduce LIBCXX_LIBRARIES_PUBLIC in addition to LIBCXX_LIBRARIES that
holds 'public' interface libraries -- that is, libraries that both
libc++ links to and programs linked against it need to link to.

Currently this includes the ABI library and optionally -lunwind (when
LIBCXXABI_USE_LLVM_UNWINDER is on). The libraries are included in the
linker script, in order to make it possible to link C++ programs using
clang with compiler-rt runtime out-of-the-box.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 10:27:45 +00:00
Eric Fiselier
cedbdd7fee Remove all _LIBCPP_VERSION tests from under test/std
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 01:32:56 +00:00
Eric Fiselier
fd1c9dddcc Purge all usages of _LIBCPP_STD_VER under test/std/algorithm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 01:25:23 +00:00
Eric Fiselier
daa895f887 Add missing <memory> include in test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 00:59:16 +00:00
Eric Fiselier
ef9e52bc90 Add missing include in test_allocator.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283632 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 00:57:56 +00:00
Eric Fiselier
124ed406e5 [libc++] Fix stack_allocator
Summary:
To quote STL the problems with stack allocator are"

>"stack_allocator<T, N> is seriously nonconformant to N4582 17.6.3.5 [allocator.requirements].
> First, it lacks a rebinding constructor. (The nested "struct rebind" isn't sufficient.)
> Second, it lacks templated equality/inequality.
> Third, it completely ignores alignment.
> Finally, and most severely, the Standard forbids its existence. Allocators are forbidden from returning memory "inside themselves". This requirement is implied by the Standard's requirements for rebinding and equality. It's permitted to return memory from a separate buffer object on the stack, though."

This patch attempts to address all of those issues.

First, instead of storing the buffer inside the allocator I've change `stack_allocator` to accept the buffer as an argument.

Second, in order to fix rebinding I changed the parameter list from `<class T, size_t NumElements>` to `<class T, size_t NumBytes>`. This allows allocator rebinding
between types that have different sizes. 

Third, I added copy and rebinding constructors and assignment operators.

And finally I fixed the allocation logic to always return properly aligned storage.



Reviewers: mclow.lists, howard.hinnant, STL_MSFT

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 00:56:22 +00:00
Marshall Clow
9c4dfbe55c Disable alignment support of 0x4000 for Win32. https://reviews.llvm.org/D25053
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 23:19:04 +00:00
Eric Fiselier
a62e1dd729 Fix PR30642 - libc++ leaks always-visible symbols into programs
This was caused by r281673, specifically changing `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS`
from `__attribute__((__type_visibility__("default")))` to
`__attribute__((__visibility("default")))`.

I made that change because I thought the external instantiations needed
their members to have default visibility. However since libc++ never builds
with -fvisibility=hidden this appears not to be needed. Instead this change
caused previously hidden inline methods to become un-hidden, which is a regression.

This patch reverts the problematic change and fixes PR30642.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 23:07:59 +00:00
Eric Fiselier
ee0db89aee Fix shadow warnings. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 22:10:35 +00:00
Eric Fiselier
2c429bee79 Fix various issues in std::any and the related tests.
* Fix self-swap. Patch from Casey Carter.

* Remove workarounds and tests for types with deleted move constructors. This
  was originally added as part of a LWG proposed resolution that has since
  changed.

* Re-apply most recent PR for LWG 2769.

* Re-apply most recent PR for LWG 2754. Specifically fix the SFINAE checks to
  use the decayed type.

* Fix tests to allow moved-from std::any's to have a non-empty state. This is
  the behavior of MSVC's std::any.

* Various whitespace and test fixes.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283606 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 21:27:45 +00:00
Eric Fiselier
45a9570f5d Remove MSVC workarounds. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 18:51:33 +00:00
Marshall Clow
1a38ecc7e1 Mark issues 2514, 2519, 2536 and 2475 as done
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:59:18 +00:00
Asiri Rathnayake
e3a71a295e [libcxx] Recover no-exceptions XFAILs - I
First batch of changes to get some of these XFAILs working in the
no-exceptions libc++ variant.

Changed some XFAILs to UNSUPPORTED where the test is all about exception
handling. In other cases, used the test macros TEST_THROW and
TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test
that concerns exception handling behaviour.

Reviewers: EricWF, mclow.lists

Differential revision: https://reviews.llvm.org/D24562

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:15:41 +00:00
Eric Fiselier
1d6b5d3ed1 Fix strict-aliasing violation in typeinfo::hash_code()
Summary:
The current implementation of `hash_code()` for uniqued RTTI strings violates strict aliasing by dereferencing a type-punned pointer. Specifically it generates a `const char**` pointer from the address of the `__name` member before casting it to `const size_t*` and dereferencing it to get the hash. This is really just a complex and incorrect way of writing `reinterpret_cast<size_t>(__name)`.

This patch changes the conversion sequence so that it no longer contains UB.


Reviewers: howard.hinnant, mclow.lists

Subscribers: rjmccall, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:55:10 +00:00
Marshall Clow
f5293bc6ac Comment out failing test while I figure out who is at fault
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:47:18 +00:00
Marshall Clow
8df21c935f Mark LWG#2679 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:36:24 +00:00
Marshall Clow
3d19a9da96 Mark LWG#2358 as done
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:02:43 +00:00
Marshall Clow
aead8da085 Make tests for is_empty better. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:01:16 +00:00
Marshall Clow
6f5d5948ef Add another append test for basic_string
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:47:13 +00:00
Marshall Clow
f257c26ec7 Mark LWG issues 2221, 2556 and 2589 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:21:11 +00:00
Eric Fiselier
8f972f6538 [libcxx] [test] Guard __has_include usage with a macro
Summary: There's a macro scheme already being used for __has_feature etc. Use it for __has_include too, which makes MSVC happy (it doesn't support __has_include yet, and unguarded use explodes horribly).

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 21:25:51 +00:00
Marshall Clow
cc30c0b9f3 Mark #2759 as ready and #2755 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 14:39:58 +00:00
Marshall Clow
10ff23dc02 Mark #2598 as ready
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 14:08:50 +00:00
Marshall Clow
8332f9b5d1 Mark #2739 as ready
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 13:41:56 +00:00
Marshall Clow
1770a8c118 Mark a couple more Issaquah issues as done: 2578 and 2738
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 23:42:31 +00:00
Marshall Clow
42a87db999 Change a couple of 'template <typename's to 'template <class' which is what we use in the rest of the library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 23:40:48 +00:00