Commit Graph

5041 Commits

Author SHA1 Message Date
Marshall Clow 05fe329687 Update commnents to reflect the changes for LWG#3122. NFC
llvm-svn: 344950
2018-10-22 20:44:37 +00:00
Billy Robert O'Neal III 95cf9fa213 [libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XX
The test is trying to avoid saying aligned_alloc on Windows' UCRT, which does not (and can not) implement aligned_alloc. However, it's testing for c1xx, meaning clang on Windows will fail this test when using the UCRT.

llvm-svn: 344829
2018-10-20 03:35:45 +00:00
Billy Robert O'Neal III 1fc51f29d7 [libcxx] [test] Add missing <stdexcept> to map at tests.
Reviewed as https://reviews.llvm.org/D50551

llvm-svn: 344821
2018-10-19 23:49:15 +00:00
Billy Robert O'Neal III e04704b9a9 Repair thread-unsafe modifications of n_alive in F.pass.cpp
In this example, the ctor of G runs in the main thread in the expression G(), and also in the copy ctor of G() in the DECAY_COPY inside std::thread. The main thread destroys the G() instance at the semicolon, and the started thread destroys the G() after it returns. Thus there is a race between the threads on the n_alive variable.

The fix is to join with the background thread before attempting to destroy the G in the main thread.

llvm-svn: 344820
2018-10-19 23:45:45 +00:00
Louis Dionne e365157ba3 [libcxx] Improve reporting when running the lit test suite
Summary:
Running the test suite with -a will now properly show all the executed
commands. The reports also include the environment under which the test
is being executed, which is helpful for reproducing issues.

Reviewers: EricWF

Subscribers: christof, dexonsmith, libcxx-commits

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

llvm-svn: 344700
2018-10-17 16:12:04 +00:00
Louis Dionne 1b22150f76 [libcxx] Mark chrono literal unit tests as being unsupported on AppleClang 10
llvm-svn: 344661
2018-10-17 00:34:13 +00:00
Louis Dionne 4084df0040 [libcxx] Avoid repeating the definition of std:: namespaces
This reduces code duplication a tiny bit.

llvm-svn: 344642
2018-10-16 20:02:59 +00:00
Louis Dionne 7833b88ad8 [libcxx] Remove _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
That macro has been defined to _LIBCPP_HIDE_FROM_ABI_AFTER_V1 for many
weeks now, so we're actually replacing uses of it for uses of
_LIBCPP_HIDE_FROM_ABI_AFTER_V1 directly.

This should not change or break anything since the two macros are
100% equivalent, unless somebody is (incorrectly!) relying on
_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY being defined.

llvm-svn: 344641
2018-10-16 19:26:23 +00:00
Marshall Clow 5b08c1742a Recommit <chrono> changes with a couple xtra tests marked to fail on apple's clang. Reviewed as D51762
llvm-svn: 344627
2018-10-16 17:27:54 +00:00
Marshall Clow 69067f2bfd Partial fix for PR38964. (<string> can't be built with gcc -std=c++03) Reviewed as https://reviews.llvm.org/D52240
llvm-svn: 344616
2018-10-16 16:02:18 +00:00
Artem Dergachev 08682bc277 Re-apply r344546 "Mark a couple of test cases as 'C++17-only'..."
Reverted too much in r344580.

llvm-svn: 344582
2018-10-16 03:36:55 +00:00
Artem Dergachev a9bc0face5 Revert r344529 "Implement the first part of the calendar support for C++20"
Revert r344535 "Wrap up the new chrono literals in an #ifdef..."
Revert r344546 "Mark a couple of test cases as 'C++17-only'..."

Some of the buildbot failures were masked by another error,
and this one was probably missed.

llvm-svn: 344580
2018-10-16 02:40:42 +00:00
Louis Dionne 950b8e114e [libcxx] Remove custom CMake code targeting Mac OS 10.6
libc++ has dropped support for Mac OS 10.6 for a while, and we don't
have any testers set up for that OS.

This commit puts in an error message so that people can reach out to
the libc++ maintainers in case support for 10.6 is still expected (as
opposed to silently failing in weird ways). We can completely drop
support for 10.6 and remove the error message some time in the future
when we're sure that nobody is relying on it.

llvm-svn: 344576
2018-10-16 00:31:32 +00:00
Marshall Clow 5c61b9d0cf Mark a couple of test cases as 'C++17-only' pending the resolution of PR#39232
llvm-svn: 344546
2018-10-15 19:46:03 +00:00
Marshall Clow 323e01d46f Wrap up the new chrono literals in an #ifdef so that old versions of clang don't complain. I'm looking at you, clang 5.0.1
llvm-svn: 344535
2018-10-15 17:33:20 +00:00
Marshall Clow 06ba9f5246 Implement the first part of the calendar support for C++20. This is still incomplete; there will be more patches coming. Reviewed as D51762
llvm-svn: 344529
2018-10-15 16:06:37 +00:00
Marshall Clow d850388710 One more local type warning removed from the tests. NFC
llvm-svn: 344421
2018-10-12 21:59:32 +00:00
Marshall Clow db49965a6b Update the array tests to not use a local type; removes warnings in C++03. NFC
llvm-svn: 344417
2018-10-12 21:24:44 +00:00
Marshall Clow 23145c6e08 Update all the max_size tests to eliminate signed/unsigned comparison warnings. NFC
llvm-svn: 344416
2018-10-12 21:22:15 +00:00
Samuel Benzaquen 0e6a833e46 Add benchmarks for std::function.
Summary:
Benchmarks for construct, copy, move, swap, destroy and invoke, with 8
different input states.
For the cases that matter, it tests with and without allowing constant
value propagation from construction into the operation tested.

This also adds helper functions to generate the cartesian product of
different configurations and generate benchmarks for all of them.

Reviewers: EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 344415
2018-10-12 21:01:15 +00:00
Louis Dionne e2441bd268 [NFC][libc++] Fix broken link in comment
llvm-svn: 344369
2018-10-12 17:12:41 +00:00
Marshall Clow c83d283a2e Revert commit r344254; does not work with C++03
llvm-svn: 344261
2018-10-11 17:28:57 +00:00
Marshall Clow e98be18311 Prefer to use the __is_XXX compiler intrinsics to the (old, busted) __has_XXX intrinsics when implementing type traits. Thanks to Richard Smith for the patch.
llvm-svn: 344254
2018-10-11 15:38:07 +00:00
Marshall Clow b198e58f67 Add a test that shows what happens with throwing destructors. NFC.
llvm-svn: 344220
2018-10-11 04:07:20 +00:00
Eric Fiselier 33e402ae2b Fix use of removed _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE
It was replaced with the better named
_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE.

llvm-svn: 344214
2018-10-11 01:48:00 +00:00
Eric Fiselier 42f9868cd8 Distinguish between library and language support for aligned allocation.
There are two cases:
1. The library has all it needs to provide align_val_t and the
new/delete overloads needed to support aligned allocation.
2. The compiler has actually turned the language feature on.

There are times where libc++ needs to distinguish between the two.

This patch adds the additional macro
_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION which denotes when case (1)
does not hold. _LIBCPP_HAS_NO_ALIGNED_ALLOCATION is defined whenever
_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION is defined, or when the
compiler has not enabled the language feature.

Additionally this patch cleans up a number of other macros related
to detection of aligned allocation machinery.

llvm-svn: 344207
2018-10-11 00:17:24 +00:00
Aaron Puchert 81d381bd7b Use TEST_STD_VER instead of __cplusplus [NFC]
While __cplusplus was only used a few dozen times, TEST_STD_VAR is used
more than 2000 times. So we replace the former by the latter for
consistency in the tests. There should be no functional change.

llvm-svn: 344194
2018-10-10 22:35:24 +00:00
Aaron Puchert 0e192395f1 Use std::scoped_lock only for C++17 and newer
This fixes a test failure caused by D53049.

llvm-svn: 344192
2018-10-10 22:05:33 +00:00
Eric Fiselier fca28db904 Add test macros for always_inline and noinline
llvm-svn: 344167
2018-10-10 18:22:23 +00:00
Eric Fiselier 5ac4e51d53 Fix linking filesystem benchmarks
llvm-svn: 344160
2018-10-10 17:46:20 +00:00
Aaron Puchert 7f208f02db Annotate scoped_lock as with scoped_lockable attribute
Summary:
Scoped capabilities need to be annotated as such, otherwise the thread
safety analysis won't work as intended.

Fixes PR39234.

Reviewers: ldionne

Reviewed By: ldionne

Subscribers: christof, libcxx-commits

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

llvm-svn: 344096
2018-10-09 23:42:29 +00:00
Louis Dionne 4ad751e5c3 [libcxx] Mark std::async race condition test as unsupported on Darwin
PR38682 added a test to check for a race condition in std::future.
Part of the fix is part of the dylib, but there is no released version
of mac OS X that ships a dylib containing the fix. Hence, this test can
(and sometimes does) when testing on OS X. This commit marks the test
as unsupported to avoid spurious failures.

llvm-svn: 344053
2018-10-09 14:57:40 +00:00
Marshall Clow 2dd5335204 Do the math in uniform_int_distribution::operator() as unsigned to prevent UB when overflowing. Also add a UBSAN notification that we're ffine with unsigned overflow. This fixes PR#32617. Thanks to Vincent & Christoph for their help with this issue.
llvm-svn: 343996
2018-10-08 20:20:34 +00:00
Marshall Clow b9f72a5a60 Papers and Issues for San Diego
llvm-svn: 343923
2018-10-06 15:07:03 +00:00
Petr Hosek 322d88f05e [CMake] Use just basename when copying C++ ABI headers
This avoids duplicate directories when the filename includes path.

Fixes PR39145

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

llvm-svn: 343753
2018-10-04 05:38:53 +00:00
Louis Dionne 98faa3976d [libc++][NFC] Add error messages to a couple of static_asserts in span
Summary:
Add error messages to a couple of static_asserts in span to match the
style used in the rest of the file. Also fix an extra paren typo in a
assert error message.

Committed on behalf of Jason Lovett.

Reviewers: ldionne

Subscribers: libcxx-commits

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

llvm-svn: 343725
2018-10-03 21:36:16 +00:00
Fangrui Song 7cd67904f7 Remove redundant null pointer check in operator delete
Summary:
C89 4.10.3.2 The free function
C99 7.20.3.2 The free function
C11 7.22.3.3 The free function

    If ptr is a null pointer, no action shall occur.

_aligned_free on MSDN:

    If memblock is a NULL pointer, this function simply performs no actions.

Reviewers: EricWF, mclow.lists, khng300, hotpxl

Reviewed By: mclow.lists, khng300, hotpxl

Subscribers: lichray, llvm-commits, hotpxl, khng300, christof, ldionne, cfe-commits, libcxx-commits

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

llvm-svn: 343503
2018-10-01 17:21:07 +00:00
Eric Fiselier b6f4d445f0 Attempt to fix aligned allocation configuration under clang-cl
When we're using clang-cl and Microsoft's runtime implementation,
we don't provide align_val_t or aligned new/delete ourselves.

This patch updates the _LIBCPP_HAS_NO_ALIGNED_ALLOCATION macro
to reflect this.

llvm-svn: 343441
2018-10-01 04:08:06 +00:00
Eric Fiselier 1f44fda0b9 Remove one more warning from clang-cl build
llvm-svn: 343440
2018-10-01 03:59:05 +00:00
Eric Fiselier a0e23576b8 Fix Shadowing warning on Windows
llvm-svn: 343439
2018-10-01 02:54:08 +00:00
Eric Fiselier 0b485f3e91 Fix even more Clang warnings.
This patch disables shift-sign-overflow warnings for now. It also
fixes most -Wfloat-equal warnings and -Wextra-semi warnings.

llvm-svn: 343438
2018-10-01 01:59:37 +00:00
Eric Fiselier cd269132ec Bump default dialect to C++14 for clang-cl
llvm-svn: 343437
2018-10-01 01:51:46 +00:00
Eric Fiselier e60359efbb Remove even more clang-cl warnings
llvm-svn: 343436
2018-10-01 01:47:23 +00:00
Eric Fiselier 356af2318d Mork more tests as FLAKY
llvm-svn: 343435
2018-10-01 01:43:42 +00:00
Eric Fiselier 5e0b8fc3fd Remove even more warnings from clang-cl build
llvm-svn: 343434
2018-10-01 01:31:23 +00:00
Eric Fiselier 0c8011f208 Turn off warnings under clang-cl
llvm-svn: 343433
2018-10-01 01:15:50 +00:00
Eric Fiselier a2d2e43bef Fix threaded test under no-threading configuration
llvm-svn: 343432
2018-10-01 01:05:51 +00:00
Eric Fiselier 11edd935c8 Attempt to unbreak Windows configuration.
Although libc++ doesn't yet support Windows we still have Windows
builders to track our progress.

Currently the clang-cl configuration seems broken because it doesn't
support -std=c++11 and instead requires /std:c++11. This patch attempts
to fix this.

llvm-svn: 343431
2018-10-01 01:00:11 +00:00
Vitaly Buka 0509070811 [cxx2a] Fix warning triggered by r343285
llvm-svn: 343369
2018-09-29 02:17:12 +00:00
Louis Dionne f9a52903ef [libc++] Remove Fuchsia-specific knowledge to pick the ABI version
Summary:
The ABI version used by libc++ is a configuration option just like any other
configuration option. It is a knob that can be used by vendors to customize
the libc++ that they ship. As such, we should not be hardcoding vendor-specific
configuration choices in libc++.

When building libc++ for Fuchsia, Fuchsia's build scripts should simply define
the libc++ ABI version to 2 -- this will result in the _LIBCPP_ABI_VERSION
macro being defined in the __config header that is generated when libc++ is
built and installed, which is the correct way to customize libc++'s behavior
for specific vendors.

Reviewers: phosek, EricWF

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

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

llvm-svn: 343079
2018-09-26 08:24:51 +00:00
Louis Dionne 3c3e1c6265 Revert r342936 "Remove redundant null pointer check in operator delete"
A review for the change was opened in https://reviews.llvm.org/D52401
but the change was committed before being approved by any of the code
owners for libc++.

llvm-svn: 342938
2018-09-25 04:13:08 +00:00
Fangrui Song 6da5366ea9 Remove redundant null pointer check in operator delete
C89 4.10.3.2 The free function
C99 7.20.3.2 The free function
C11 7.22.3.3 The free function

    If ptr is a null pointer, no action shall occur.

_aligned_free on MSDN:

    If memblock is a NULL pointer, this function simply performs no actions.

Reviewers: EricWF, mclow.lists

Subscribers: christof, ldionne, cfe-commits, libcxx-commits

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

llvm-svn: 342936
2018-09-25 02:50:57 +00:00
Louis Dionne 255f376f6b [libcxx] Fix the binder deprecation tests on Clang 5.
Tested on Docker containers with Clang 4, 5 and 6.

llvm-svn: 342855
2018-09-23 23:17:48 +00:00
Louis Dionne 593b23f6a7 [libcxx] Fix buildbots on Debian
Debian build bots are running Clang 4, which apparently does not support
the "deprecated" attribute properly. Clang pretends to support the attribute,
but the attribute doesn't do anything.

(live example: https://wandbox.org/permlink/0De69aXns0t1D59r)

On a separate note, I'm not sure I understand why we're even running the
libc++ tests under Clang-4. Is this a configuration we support? I can
understand that libc++ should _build_ with Clang 4, but it's not clear
to me that new libc++ headers should be usable under older compilers
like that.

llvm-svn: 342854
2018-09-23 22:16:35 +00:00
Louis Dionne 436a40128c [libcxx] Document new symbols __u64toa and __u32toa on Darwin
Summary:
This is the counterpart for https://reviews.llvm.org/D50130 and
https://reviews.llvm.org/D52391 on Darwin.

Reviewers: EricWF

Subscribers: christof, dexonsmith, cfe-commits, libcxx-commits, lichray

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

llvm-svn: 342849
2018-09-23 21:10:06 +00:00
Louis Dionne ea5cd3b476 [libc++] Add deprecated attributes to many deprecated components
Summary:
These deprecation warnings are opt-in: they are only enabled when the
_LIBCXX_DEPRECATION_WARNINGS macro is defined, which is not the case
by default. Note that this is a first step in the right direction, but
I wasn't able to get an exhaustive list of all deprecated components
per standard, so there's certainly stuff that's missing. The list of
components this commit marks as deprecated is:

in C++11:
- auto_ptr, auto_ptr_ref
- binder1st, binder2nd, bind1st(), bind2nd()
- pointer_to_unary_function, pointer_to_binary_function, ptr_fun()
- mem_fun_t, mem_fun1_t, const_mem_fun_t, const_mem_fun1_t, mem_fun()
- mem_fun_ref_t, mem_fun1_ref_t, const_mem_fun_ref_t, const_mem_fun1_ref_t, mem_fun_ref()

in C++14:
- random_shuffle()

in C++17:
- unary_negate, binary_negate, not1(), not2()

<rdar://problem/18168350>

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, llvm-commits

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

llvm-svn: 342843
2018-09-23 18:35:00 +00:00
Louis Dionne 0805a4fa9c [NFC][libcxx] Rename helpers with 4 underscores to something more reasonable
llvm-svn: 342840
2018-09-23 16:44:50 +00:00
Louis Dionne 95530082c4 [NFC][libc++] Fix typo in the description of LIBCXX_INCLUDE_BENCHMARKS
llvm-svn: 342822
2018-09-22 21:30:12 +00:00
Eric Fiselier a793b84d81 Mark [[nodiscard]] tests unsupported on GCC prior to 7.0
llvm-svn: 342821
2018-09-22 21:01:07 +00:00
Eric Fiselier 67e881d112 Fix UB in SIMD tests.
One of the SIMD tests attempted to left shift a value by 42, which
is UB when the left hand side is a 32 bit integer type.

This patch adjusts the test to use the value 4 instead of 42.

llvm-svn: 342820
2018-09-22 20:09:02 +00:00
Roman Lebedev 2f02863bf2 [libcxx] Readjust nodiscard_extensions.pass.cpp test - just disable for ASAN
In rL342814, i have committed a blind fix to unbreak the asan buildbot,
but as it was later discussed, the leak is intentional,
so we can not fix the failure that way.

So this reverts the leak 'fix',
and simply disables the test in the presence of ASAN.

llvm-svn: 342819
2018-09-22 20:07:02 +00:00
Eric Fiselier 76c83ea16d Mark test as flaky
llvm-svn: 342818
2018-09-22 20:03:47 +00:00
Eric Fiselier 0ef540bd51 Correct docs to reference the new libc++ lists.
We recently added libcxx-dev and libcxx-commits mailing lists.
This patch updates the libc++ documentation to correctly reference
the libc++ lists instead of the old Clang ones.

llvm-svn: 342816
2018-09-22 19:49:29 +00:00
Roman Lebedev 931d66cd22 [libcxx] Blind attempt to fix harmless leak in nodiscard_extensions.pass.cpp test
libcxx-libcxxabi-x86_64-linux-ubuntu-asan complains about a leak here.

llvm-svn: 342814
2018-09-22 19:09:57 +00:00
Louis Dionne 8a15c924ae [libcxx] Fix the definition of the check-cxx-abilist target on Darwin
Summary:
r342805 added support for the check-cxx-abilist target on FreeBSD, but broke
the target on macOS in doing so. The problem is that the GENERIC_TARGET_TRIPLE
gets overwritten after replacing the FreeBSD regular expression, which
nullifies the replacement done with the darwin regular expression.

Reviewers: dim, EricWF

Subscribers: emaste, mgorny, krytarowski, christof, dexonsmith, cfe-commits, libcxx-commits

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

llvm-svn: 342813
2018-09-22 18:39:38 +00:00
Zhihao Yuan dbbb4b104d Document new symbols for __u64toa and __u32toa
Summary:
They are introduced in r338479; their Linux ABI changes are recorded in r338486.

TODO: Record the Mac OS X ABI changes.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits, cfe-commits

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

llvm-svn: 342810
2018-09-22 18:05:28 +00:00
Roman Lebedev c65d39a464 [libc++] Add _LIBCPP_ENABLE_NODISCARD and _LIBCPP_NODISCARD_EXT to allow pre-C++2a [[nodiscard]]
Summary:
The `[[nodiscard]]` attribute is intended to help users find bugs where
function return values are ignored when they shouldn't be. After C++17 the
C++ standard has started to declared such library functions as `[[nodiscard]]`.
However, this application is limited and applies only to dialects after C++17.
Users who want help diagnosing misuses of STL functions may desire a more
liberal application of `[[nodiscard]]`.

For this reason libc++ provides an extension that does just that! The
extension must be enabled by defining `_LIBCPP_ENABLE_NODISCARD`. The extended
applications of `[[nodiscard]]` takes two forms:

1. Backporting `[[nodiscard]]` to entities declared as such by the
   standard in newer dialects, but not in the present one.

2. Extended applications of `[[nodiscard]]`, at the libraries discretion,
   applied to entities never declared as such by the standard.

Users may also opt-out of additional applications `[[nodiscard]]` using
additional macros.

Applications of the first form, which backport `[[nodiscard]]` from a newer
dialect may be disabled using macros specific to the dialect it was added. For
example `_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17`.

Applications of the second form, which are pure extensions, may be disabled
by defining `_LIBCPP_DISABLE_NODISCARD_EXT`.

This patch was originally written by me (Roman Lebedev),
then but then reworked by Eric Fiselier.

Reviewers: mclow.lists, thakis, EricWF

Reviewed By: thakis, EricWF

Subscribers: llvm-commits, mclow.lists, lebedev.ri, EricWF, rjmccall, Quuxplusone, cfe-commits, christof

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

llvm-svn: 342808
2018-09-22 17:54:48 +00:00
Dimitry Andric f3b94728c7 Similar to the handling of darwin target triples, strip the version
numbers off of freebsd target triples, when generating the name of the
ABI list file for check-cxx-abilist target.

Also remove unnecessary parentheses in the regex for darwin, and
slightly reword the comment.

llvm-svn: 342805
2018-09-22 14:37:49 +00:00
Sylvestre Ledru 6616b4c9e9 fix some typos in the doc
llvm-svn: 342628
2018-09-20 08:05:01 +00:00
Sylvestre Ledru 8e5a0b1f7b add a quick link to libc++abi
llvm-svn: 342625
2018-09-20 07:58:43 +00:00
Sylvestre Ledru 0296eea49b refresh the libc++ homepage
llvm-svn: 342624
2018-09-20 07:57:31 +00:00
Eric Fiselier 2d79835ccb Fix diagnostic regex in variant tests to tolerate older clang versions
llvm-svn: 342609
2018-09-20 01:15:17 +00:00
Volodymyr Sapsai 8d6ac8f689 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:

llvm-svn: 342599
2018-09-19 23:31:34 +00:00
Marshall Clow 4a71f9cfcc Implement LWG 2221 - No formatted output operator for nullptr. Reviewed as https://reviews.llvm.org/D44263
llvm-svn: 342566
2018-09-19 18:29:57 +00:00
Eric Fiselier 7dca3127c2 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.

llvm-svn: 342560
2018-09-19 17:53:21 +00:00
Marshall Clow 8ae45e0e59 Remove unused include of "verbose_assert.h"
llvm-svn: 342524
2018-09-19 02:27:44 +00:00
Fangrui Song cac6d21731 Fix typo
llvm-svn: 342361
2018-09-17 07:40:42 +00:00
Marshall Clow 08ebf19e52 Mark LWG#3102 as complete. No code changes, but I updated a test or two
llvm-svn: 342103
2018-09-13 02:23:52 +00:00
Marshall Clow f56972e224 Implement the infrastructure for feature-test macros. Very few actual feature test macros, though. Reviewed as: https://reviews.llvm.org/D51955
llvm-svn: 342073
2018-09-12 19:41:40 +00:00
Marshall Clow a4ce437104 Actually mark LWG#2953, don't just say you've done so in r342070
llvm-svn: 342071
2018-09-12 18:53:02 +00:00
Marshall Clow 71f7d7b1c7 mark LWG#2953 as complete. No code changes required, but added a couple of extra tests.
llvm-svn: 342070
2018-09-12 18:51:12 +00:00
Marshall Clow 4d0509f61a 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.
llvm-svn: 342063
2018-09-12 16:59:09 +00:00
Marshall Clow ebff3123a2 Implement LWG #3017. list splice functions should use addressof
llvm-svn: 342057
2018-09-12 14:46:17 +00:00
Marshall Clow 48e5b8b1a4 Update the synopsis for <version>. NFC
llvm-svn: 341990
2018-09-11 20:51:54 +00:00
Marshall Clow e9cc545129 Fix PR# 38900 - don't call swap inside of random_shuffle when we'd be swapping an element with itself
llvm-svn: 341975
2018-09-11 18:33:45 +00:00
Hans Wennborg 462429c03d ReleaseNotes: update links to use https
llvm-svn: 341789
2018-09-10 08:57:12 +00:00
Marshall Clow 226c14a5fa [asan] Update a vector's storage annotation during destruction. Reviewed as https://reviews.llvm.org/D50101. Thanks to bobsayshilol (Ben) for the patch.
llvm-svn: 341671
2018-09-07 15:47:59 +00:00
Louis Dionne 38895a0d80 [libc++] Add a link to the Release notes from the main libc++ documentation
llvm-svn: 341551
2018-09-06 15:05:43 +00:00
Louis Dionne 0fb7c99001 [libcxx] Add ReleaseNotes.rst file for release notes
llvm-svn: 341550
2018-09-06 14:46:22 +00:00
Marshall Clow d0ab67f7d0 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.
llvm-svn: 340992
2018-08-29 23:02:15 +00:00
Marshall Clow fa8ce34534 Use addressof instead of operator& in make_shared. Fixes PR38729. As a drive-by, make the same change in raw_storage_iterator (twice).
llvm-svn: 340823
2018-08-28 13:29:30 +00:00
Richard Smith 67c364dd9b Fix ODR violation: namespace-scope helpers should not be declared 'static'.
llvm-svn: 340778
2018-08-27 21:41:50 +00:00
Marshall Clow 05ff3d3bf7 Mark P0556 as 'in progress'
llvm-svn: 340752
2018-08-27 16:07:01 +00:00
Louis Dionne 954d4a2235 [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

llvm-svn: 340609
2018-08-24 14:10:28 +00:00
Louis Dionne 616ef1863f [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

llvm-svn: 340608
2018-08-24 14:00:59 +00:00
Erik Pilkington cda06daf3f Comment out #define __cpp_lib_node_extract, we only support half of that functionality
Differential revision: https://reviews.llvm.org/D51172

llvm-svn: 340544
2018-08-23 17:08:02 +00:00
Reid Kleckner a65d943e33 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.

llvm-svn: 340427
2018-08-22 17:47:41 +00:00
Eric Fiselier a60d7fac09 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.

llvm-svn: 340426
2018-08-22 17:47:13 +00:00
Eric Fiselier 0353308710 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.

llvm-svn: 340406
2018-08-22 13:29:52 +00:00
Marshall Clow 934e9a3976 Fix Bug 38644: multimap::clear() missing exception specifier. Add noexcept tests for all the containers that have clear().
llvm-svn: 340385
2018-08-22 04:28:43 +00:00