5134 Commits

Author SHA1 Message Date
Dimitry Andric
6bcb2dcb03 Remove a bunch of empty subdirectories. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342803 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-22 13:32:37 +00:00
Sylvestre Ledru
8f4c8e666e fix some typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342628 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 08:05:01 +00:00
Sylvestre Ledru
e404320723 add a quick link to libc++abi
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342625 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 07:58:43 +00:00
Sylvestre Ledru
ac2b5703bb refresh the libc++ homepage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342624 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 07:57:31 +00:00
Eric Fiselier
087a509b66 Fix diagnostic regex in variant tests to tolerate older clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342609 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 01:15:17 +00:00
Volodymyr Sapsai
e59d098825 Revert "Implement LWG 2221 - No formatted output operator for nullptr."
This reverts r342566 as it causes on bots linker errors like

> Undefined symbols for architecture i386:
>   "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::nullptr_t)", referenced from:


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 23:31:34 +00:00
Marshall Clow
f06032bb0a Implement LWG 2221 - No formatted output operator for nullptr. Reviewed as https://reviews.llvm.org/D44263
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 18:29:57 +00:00
Eric Fiselier
989927cc37 Don't require relops on variant alternatives to all return the same
type.

Libc++ correctly asserts that a set of visitors for a variant all
return the same type. However, we use the visitation machinary to
perform relational operations. This causes a static assertion when
some of the alternatives relops return a UDT which is implicitly
convertible to bool instead of 'bool' exactly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342560 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 17:53:21 +00:00
Marshall Clow
699cb5b3b8 Remove unused include of "verbose_assert.h"
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342524 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 02:27:44 +00:00
Fangrui Song
35a0c2ce5e Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342361 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 07:40:42 +00:00
Marshall Clow
1755c75e7e Mark LWG#3102 as complete. No code changes, but I updated a test or two
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342103 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-13 02:23:52 +00:00
Marshall Clow
e3973fd962 Implement the infrastructure for feature-test macros. Very few actual feature test macros, though. Reviewed as: https://reviews.llvm.org/D51955
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342073 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 19:41:40 +00:00
Marshall Clow
420ace6f28 Actually mark LWG#2953, don't just say you've done so in r342070
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 18:53:02 +00:00
Marshall Clow
c106dd615d mark LWG#2953 as complete. No code changes required, but added a couple of extra tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342070 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 18:51:12 +00:00
Marshall Clow
575d6888eb Update the failure annotations for the uncaught_exceptions test. The underlying abi library on some Mac OS versions does not support the plural uncaught_exceptions, so libc++ emulates it from the singlar; this means it will only return 0 or 1.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342063 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 16:59:09 +00:00
Marshall Clow
ec25143bbb Implement LWG #3017. list splice functions should use addressof
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342057 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 14:46:17 +00:00
Marshall Clow
bf9b545a05 Update the synopsis for <version>. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@341990 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 20:51:54 +00:00
Marshall Clow
53c8e25037 Fix PR# 38900 - don't call swap inside of random_shuffle when we'd be swapping an element with itself
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@341975 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 18:33:45 +00:00
Hans Wennborg
5a86ba0aa0 ReleaseNotes: update links to use https
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@341789 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-10 08:57:12 +00:00
Marshall Clow
8c58c22937 [asan] Update a vector's storage annotation during destruction. Reviewed as https://reviews.llvm.org/D50101. Thanks to bobsayshilol (Ben) for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@341671 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 15:47:59 +00:00
Louis Dionne
6969dc114e [libc++] Add a link to the Release notes from the main libc++ documentation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@341551 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 15:05:43 +00:00
Louis Dionne
fa8c5393b4 [libcxx] Add ReleaseNotes.rst file for release notes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@341550 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 14:46:22 +00:00
Marshall Clow
8220dac54c Last week, someone noted that a couple of the time_point member functions were not constexpr. I looked, and they were right. They were made constexpr in p0505, so I looked at all the other bits in that paper to make sure that I didn't miss anything else. There were a couple methods in the synopsis that should have been marked constexpr, but the code was correct.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340992 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 23:02:15 +00:00
Marshall Clow
c4f0f1eaa8 Use addressof instead of operator& in make_shared. Fixes PR38729. As a drive-by, make the same change in raw_storage_iterator (twice).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340823 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 13:29:30 +00:00
Richard Smith
f45b25b18d Fix ODR violation: namespace-scope helpers should not be declared 'static'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340778 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 21:41:50 +00:00
Marshall Clow
e45e0640b6 Mark P0556 as 'in progress'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340752 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 16:07:01 +00:00
Louis Dionne
cd04d45e3a [libc++] Fix handling of negated character classes in regex
Summary:
This commit fixes a regression introduced in r316095, where we don't match
inverted character classes when there's no negated characrers in the []'s.

rdar://problem/43060054

Reviewers: mclow.lists, timshen, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340609 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 14:10:28 +00:00
Louis Dionne
39ad1d12c1 [libc++] Remove race condition in std::async
Summary:
The state associated to the future was set in one thread (with synchronization)
but read in another thread without synchronization, which led to a data race.

https://bugs.llvm.org/show_bug.cgi?id=38181
rdar://problem/42548261

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340608 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 14:00:59 +00:00
Erik Pilkington
b2dd7690ab Comment out #define __cpp_lib_node_extract, we only support half of that functionality
Differential revision: https://reviews.llvm.org/D51172

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340544 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 17:08:02 +00:00
Reid Kleckner
ed6c20e48d Disable the aligned allocation test on old mac versions instead of XFAILing it
It looks like this test XPASSes when the deployment target is older than
the OS of the system the test is running on. It looks like we run the
tests with -mmacosx-version-min=10.12, and that makes the test expect to
fail, but it passes.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340427 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 17:47:41 +00:00
Eric Fiselier
c39fe08b20 Add diagnostics for min/max algorithms when a InputIterator is used.
These algorithms require a ForwardIterator or better. Ensure
we diagnose the contract violation at compile time instead of
of silently doing the wrong thing.

Further algorithms will be audited in upcoming patches.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340426 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 17:47:13 +00:00
Eric Fiselier
1e22fa5b1b Attempt to unbreak filesystem tests on certain linux distros.
On some platforms clock_gettime is in librt, which we don't
link by default when building the tests. However it is required
by the filesystem tests.

This patch introduces a workaround which links librt whenever
the filesystem tests are enabled. The workaround should later
be replaced with a patch that selectively links both libc++fs
and librt only when building filesystem specific tests. However,
the way the test configuration is set up right now, this is
non-trivial.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340406 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 13:29:52 +00:00
Marshall Clow
4c90425692 Fix Bug 38644: multimap::clear() missing exception specifier. Add noexcept tests for all the containers that have clear().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340385 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 04:28:43 +00:00
Kamil Rytarowski
36711b2482 Teach libc++ to use native NetBSD's max_align_t
Summary:
The NetBSD headers ship with max_align_t, that is not
compatible with the fallback version in libc++.

There is no defined a compiler specific symbol in the headers like:
 - __CLANG_MAX_ALIGN_T_DEFINED
 - _GCC_MAX_ALIGN_T
 - __DEFINED_max_align_t

Sponsored by <The NetBSD Foundation>

Reviewers: chandlerc, dlj, EricWF, joerg

Reviewed By: joerg

Subscribers: bsdjhb, llvm-commits, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340224 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 22:29:20 +00:00
Marshall Clow
f017e1e2a4 Refactor the newly created <bit> header. Still (almost) NFC. Reviewed as https://reviews.llvm.org/D50876
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340049 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 17:27:25 +00:00
Marshall Clow
6c372355ba Recommit r339943 - Establish the <bit> header. NFC yet. Reviewed as https://reviews.llvm.org/D50815 - with a fix for the sanitizer bots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340045 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 16:07:48 +00:00
Vitaly Buka
245791ae73 Revert "Establish the <bit> header. NFC yet. Reviewed as https://reviews.llvm.org/D50815"
Breaks build on sanitizer bots.

This reverts commit r339943.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339971 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 23:57:16 +00:00
Hubert Tong
aec9e0e5a2 [libc++] Use correct rand.eng.mers all-zeroes seed sequence fallback
Summary:
When a seed sequence would lead to having no non-zero significant bits
in the initial state of a `mersenne_twister_engine`, the fallback is to
flip the most significant bit of the first value that appears in the
textual representation of the initial state.

rand.eng.mers describes this as setting the value to be 2 to the power
of one less than w; the previous value encoded in the implementation,
namely one less than "2 to the power of w", is replaced by the correct
value in this patch.

Reviewers: mclow.lists, EricWF, jasonliu

Reviewed By: mclow.lists

Subscribers: mclow.lists, jasonliu, EricWF, christof, ldionne, cfe-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339969 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 23:56:54 +00:00
Marshall Clow
fbd46738b1 Establish the <bit> header. NFC yet. Reviewed as https://reviews.llvm.org/D50815
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339943 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 21:35:38 +00:00
Louis Dionne
61b0a0088b [libcxx] By default, do not use internal_linkage to hide symbols from the ABI
Summary:
https://reviews.llvm.org/D49240 led to symbol size problems in Chromium, and
we expect this may be the case in other projects built in debug mode too.
Instead, unless users explicitly ask for internal_linkage, we use always_inline
like we used to.

In the future, when we have a solution that allows us to drop always_inline
without falling back on internal_linkage, we can replace always_inline by
that.

Note that this commit introduces a change in contract for existing libc++
users: by default, libc++ used to guarantee that TUs built with different
versions of libc++ could be linked together. With the introduction of the
_LIBCPP_HIDE_FROM_ABI_PER_TU macro, the default behavior is that TUs built
with different libc++ versions are not guaranteed to link. This is a change
in contract but not a change in behavior, since the current implementation
still allows linking TUs built with different libc++ versions together.

Reviewers: EricWF, mclow.lists, dexonsmith, hans, rnk

Subscribers: christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339874 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 12:44:28 +00:00
Marshall Clow
43d7c79aae Selectively import timespec_get into namespace std, since some C libraries don't have it. Reviewed as https://reviews.llvm.org/D50799
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339816 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 21:19:08 +00:00
Marshall Clow
a87d98049c Mark the at_exit and at_quick_exit tests as unsupported under C++98 an 03, since those calls were introduced in C++11. They're already guarded by an ifdef in the code, so this is a 'belt-and-suspenders' change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339804 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 19:27:53 +00:00
Peter Collingbourne
62176005c3 libcxx: Mark __temp_value::__temp_value as _LIBCPP_NO_CFI.
This constructor needs to cast a pointer to uninitialized
memory to a pointer to object type in order to call
allocator_traits::construct(). This cast is not allowed when CFI cast
checks are enabled.

I did this instead of marking __addr() as _LIBCPP_NO_CFI so that we
don't lose CFI checks on get() or the dtor.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339797 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 17:49:30 +00:00
Dimitry Andric
f27313afa2 For FreeBSD, don't define _M in nasty_macros.hpp
Because FreeBSD uses _M in its <sys/types.h>, and it is hard to avoid
including that header, only define _M to NASTY_MACRO for other operating
systems.  This fixes almost 2000 unexpected test failures.

Discussed with Eric Fiselier.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339794 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 17:30:32 +00:00
Louis Dionne
a1b4766c47 [libcxx] Fix XFAILs for aligned allocation tests on older OSX versions
Summary:
Since r338934, Clang emits an error when aligned allocation functions are
used in conjunction with a system libc++ dylib that does not support those
functions. This causes some tests to fail when testing against older libc++
dylibs. This commit marks those tests as UNSUPPORTED, and also documents the
various reasons for the tests being unsupported.

Reviewers: vsapsai, EricWF

Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339743 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 00:30:03 +00:00
Louis Dionne
010c53f892 [libc++] Disable failing C11 feature tests for <cfloat> and <float.h>
Summary:
Those tests are breaking the test bots. A Bugzilla has been filed to
make sure those tests are re-enabled: https://bugs.llvm.org/show_bug.cgi?id=38572

Reviewers: mclow.lists, EricWF

Subscribers: krytarowski, christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339742 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 00:18:01 +00:00
Louis Dionne
51a2f0c64a [libc++] Detect C11 features on non-Clang compilers
Summary:
The macros were inside `#if defined(_LIBCPP_COMPILER_CLANG)`, which means
we would never detect C11 features on non-Clang compilers. According to
Marshall Clow, this is not the intended behavior.

Reviewers: mclow.lists, EricWF

Subscribers: krytarowski, christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339741 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 00:16:41 +00:00
Louis Dionne
cbc40b6d2e [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
Summary:
The macro was not defined in C++11 mode when it should have been, at least
according to how _LIBCPP_HAS_C11_FEATURES is defined.

Reviewers: mclow.lists, EricWF, jfb, dexonsmith

Subscribers: christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339702 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 18:16:56 +00:00
Martin Storsjo
8ddc6c6199 [CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY option
This option should be available if LIBCXX_ENABLE_SHARED is enabled,
not LIBCXX_ENABLE_STATIC.

This fixes a typo from SVN r337814.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339697 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 17:33:10 +00:00
Louis Dionne
4d5214346e [libc++] Add missing #include in C11 features tests
Summary:
These #includes are quite important, since otherwise any

    #if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)

checks are always false, and so we don't actually test for C11 support
in the standard library.

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@339675 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 13:29:17 +00:00