Commit Graph

3706 Commits

Author SHA1 Message Date
Eric Fiselier 8882eeece9 Add missing libc++ import
llvm-svn: 294673
2017-02-10 00:01:01 +00:00
Eric Fiselier d57282791d add missing python import
llvm-svn: 294660
2017-02-09 23:29:08 +00:00
Eric Fiselier 4f258efad7 Move libcxx/test/libcxx python package into libcxx/utils/libcxx.
This patch merges the test python package with the newly
created package in utils.

llvm-svn: 294651
2017-02-09 23:18:11 +00:00
Eric Fiselier 0b37f209bf Start libc++ python cleanup and consolidation.
Libc++ frequently creates and uses utilities written in python.
Currently there are python modules under both libcxx/test and
libcxx/util. My goal with these changes is to consolidate them
into a single package under libcxx/utils/libcxx.

llvm-svn: 294644
2017-02-09 22:53:14 +00:00
Eric Fiselier a18ef6f1f9 Fix PR31916 - std::visit rejects visitors accepting lvalue arguments
A static assertion was misfiring since it checked
is_callable<Visitor, decltype(__variant_alt<T>.value)>. However
the decltype expression doesn't capture the value category as
required. This patch applies extra braces to decltype to fix
that.

llvm-svn: 294612
2017-02-09 19:01:22 +00:00
Joerg Sonnenberger 9e8a082db4 Use protected name for the prototype arguments.
llvm-svn: 294585
2017-02-09 14:12:29 +00:00
Asiri Rathnayake 54a987e1f1 Threading support: externalize sleep_for() function.
Different platforms implement the wait/sleep functions in difrerent ways.
It makes sense to externalize this into the threading API.

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

Reviewers: EricWF, joerg
llvm-svn: 294573
2017-02-09 09:31:41 +00:00
Petr Hosek b494288b9e [libcxx][CMake] Support in-tree libunwind when building as part of runtimes
When building as part of runtimes, there is no predefined order in
which the runtimes are loaded, so the targets from other projects
might not be available. We need to rely on HAVE_<name> variables
instead in that case.

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

llvm-svn: 294553
2017-02-09 02:19:43 +00:00
Eric Fiselier 4ae0369b8e Update info for LWG 2665 in upcoming_meeting.html
llvm-svn: 294501
2017-02-08 19:04:18 +00:00
Michal Gorny f7132c83f1 [test] Fix hard_link_count test to account for fs with dir nlink==1
Filesystems are not required to maintain a hard link count consistent
with number of subdirectories. For example, on btrfs all directories
have nlink==1. Account for that in the test.

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

llvm-svn: 294431
2017-02-08 09:57:32 +00:00
Marshall Clow a2e54b632e Temporarily disable the LCM/GCD tests under UBSAN.
llvm-svn: 294417
2017-02-08 07:40:59 +00:00
Eric Fiselier d35528b3e7 Add missing include in <numeric>
llvm-svn: 294393
2017-02-08 00:14:13 +00:00
Eric Fiselier 4cdd915fda Prevent UBSAN from generating unsigned overflow diagnostics in the hashing internals
llvm-svn: 294391
2017-02-08 00:10:10 +00:00
Eric Fiselier c0d5590a3b Fix bugs in filesystem detected by _LIBCPP_ASSERT.
Recently I turned on libc++'s debug mode assertions when
CMake is configured with -DLIBCXX_ENABLE_ASSERTIONS=ON. This
change exposed assertion failures caused by bugs in filesystem.
This patch fixes those failures.

The first bug was that `PathParser` was using front()/back()
on empty string views in order to get the address of the character.
However this is UB on empty strings. Those operations now use data()
to obtain the pointer.

The second bug was that directory_iterator attempted to capture errno when it
was unset and there was an assertion to detect this.

llvm-svn: 294360
2017-02-07 21:51:58 +00:00
Eric Fiselier 357120e8a2 fix python3 syntax error
llvm-svn: 294355
2017-02-07 21:21:17 +00:00
Eric Fiselier d8f7f31121 Fix test failures when using modules.
llvm-svn: 294353
2017-02-07 21:20:31 +00:00
Dan Albert 71478363d5 Use copy.deepcopy instead of doing it manually.
Reviewers: EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

llvm-svn: 294350
2017-02-07 21:04:19 +00:00
Marshall Clow 4513057d66 Stop using random_shuffle in the libc++ test suite. It's going to be removed in c++17. Use shuffle() instead. No change to libc++, just the tests.
llvm-svn: 294328
2017-02-07 18:41:25 +00:00
Marshall Clow 891239e64f Mark LWG2784 as ready
llvm-svn: 294311
2017-02-07 15:34:20 +00:00
Saleem Abdulrasool 833cf8bdb6 filesystem: return the constructed object
This really should get identified properly by the compiler to convert to
a NVRO, but compress the code anyways.  This makes the implementation
identical to directory_iterator.cpp

llvm-svn: 294270
2017-02-07 02:46:59 +00:00
Marshall Clow 7a1c0efff4 Add some tests to verify that we implement LWG#2837 correctly. No functional change.
llvm-svn: 294194
2017-02-06 16:03:23 +00:00
Marshall Clow 01595ef77d Fix a typo - extra '>'
llvm-svn: 294190
2017-02-06 15:29:03 +00:00
Marshall Clow 62ab88143e Set up 'upcoming meeting' bug list
llvm-svn: 294189
2017-02-06 15:17:22 +00:00
Saleem Abdulrasool bcc85cbcde Refer to _LIBCPP_MSVC macro where applicable
Replace preprocess conditions of defined(_MSC_VER) &&
!defined(__clang__) with defined(_LIBCPP_MSVC).  NFC.

Patch by Dave Lee!

llvm-svn: 294171
2017-02-06 05:26:49 +00:00
Eric Fiselier 25e9c7aa55 Mark LWG 2765 as complete. No changes needed
llvm-svn: 294167
2017-02-06 02:41:49 +00:00
Eric Fiselier 9af60c4a8b Implement LWG 2773 - std::ignore should be constexpr.
In addition to the PR for LWG 2773 this patch also ensures
that each of std::ignores constructors or assignment operators
are constexpr.

llvm-svn: 294165
2017-02-06 01:25:31 +00:00
Stephan T. Lavavej 134ed9986a [libcxx] [test] Strip trailing whitespace.
No functional change, no code review.

llvm-svn: 294161
2017-02-05 22:48:27 +00:00
Stephan T. Lavavej 881d861346 [libcxx] [test] Fix comment typos.
No functional change, no code review.

llvm-svn: 294160
2017-02-05 22:48:20 +00:00
Stephan T. Lavavej ae2798fc53 [libcxx] [test] Avoid MSVC's non-Standard ABI in underlying_type.pass.cpp.
When compiled with Clang for Windows, this was emitting "enumerator value
evaluates to 4294967295, which cannot be narrowed to type 'int' [-Wc++11-narrowing]".

The test should more strenuously avoid poking this ABI deficiency (and it
already has coverage for explicitly specified underlying types).

Fixes D29140.

llvm-svn: 294159
2017-02-05 22:48:13 +00:00
Stephan T. Lavavej 0d6482f3bb [libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object prevents copy elision".
N4618 30.6.6 [futures.unique_future]/12 declares "shared_future<R> share() noexcept;".

Fixes D29139.

llvm-svn: 294158
2017-02-05 22:48:07 +00:00
Stephan T. Lavavej 3c56112e3f [libcxx] [test] Fix Clang -Wdeprecated-declarations with MSVC's CRT.
libcxx's tests use various C Standard Library functions that have been
marked by MSVC's CRT as deprecated by Microsoft (not by ISO).

libcxx's usage is cromulent (just checking with decltype to see if the functions
are being dragged in by various headers as required by the Standard), so
defining _CRT_SECURE_NO_WARNINGS will silence the warnings in a targeted manner.
This needs to be defined before including any CRT headers.

Also, make this file prettier.

Fixes D29138.

llvm-svn: 294157
2017-02-05 22:48:02 +00:00
Stephan T. Lavavej 8bb0ffb072 [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.
test/std/strings/string.classes/typedefs.pass.cpp
Actually test what basic_string's typedefs stand for.

test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
NotDerived and ND were completely unused.

test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
P2 was mistakenly not being used. Yes, that's
right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING!

Fixes D29137.

llvm-svn: 294156
2017-02-05 22:47:54 +00:00
Stephan T. Lavavej 50bd9576f0 [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.
These typedefs were completely unused.

Fixes D29136.

llvm-svn: 294155
2017-02-05 22:47:41 +00:00
Stephan T. Lavavej 03fe6e2da2 [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.
Guard typedefs and static_asserts with _LIBCPP_VERSION.

test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
Additionally deal with conditional compilation.

test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
Additionally deal with typedefs used by other typedefs.

Fixes D29135.

llvm-svn: 294154
2017-02-05 22:47:09 +00:00
Marshall Clow 6a1d078560 Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today.
llvm-svn: 294142
2017-02-05 20:52:32 +00:00
Eric Fiselier 46663d5567 Fix variant build errors with GCC 7
llvm-svn: 294141
2017-02-05 20:36:07 +00:00
Eric Fiselier 623fee72c6 Adjust Apple ABI list after r294133
llvm-svn: 294139
2017-02-05 20:17:41 +00:00
Eric Fiselier abf80c6949 Adjust Linux ABI list after r294133
llvm-svn: 294138
2017-02-05 20:14:18 +00:00
Marshall Clow e29b1ed50b Change the base class of std::bad_optional_access. This is a (subtle) ABI change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error.
llvm-svn: 294133
2017-02-05 20:06:38 +00:00
Saleem Abdulrasool 2f7ceb120e filesystem: fix n4100 conformance for `temp_directory_path`
N4100 states that an error shall be reported if
`!exists(p) || !is_directory(p)`.  We were missing the first half of the
conditional.  Invert the error and normal code paths to make the code
easier to follow.

llvm-svn: 294127
2017-02-05 17:21:52 +00:00
Eric Fiselier f1fe87e605 Remove CMake hack
llvm-svn: 294116
2017-02-05 01:19:02 +00:00
Eric Fiselier cd1703b241 Fix typo in docs
llvm-svn: 294115
2017-02-05 01:16:25 +00:00
Eric Fiselier e49cdfbeea Recommit [libcxx] Never use <cassert> within libc++
It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`.
This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead.

Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS`  off by default,
because the standard library should not be aborting user programs unless explicitly asked to.

llvm-svn: 294107
2017-02-04 23:22:28 +00:00
Eric Fiselier 5ddaeb888d Fix inconsistency in tuple's SFINAE. Patch from Andrey Khalyavin"
llvm-svn: 294106
2017-02-04 22:57:01 +00:00
Eric Fiselier dfc9947636 Mark basic_string::assign templates as inline to improve ABI stability.
Visible definitions for basic_string::assign are sometimes emitted in
the dylib depending on the version of LLVM used to compile libc++.
This can cause the check-cxx-abilist target to fail.

This patch attempts marks the basic_string::assign templates as inline
to prevent this. That way the export list is consistent across LLVM
versions.

llvm-svn: 294100
2017-02-04 20:38:35 +00:00
Eric Fiselier fb5c750222 Undefine min/max in __tree
llvm-svn: 294099
2017-02-04 20:27:46 +00:00
Dan Albert f9dc6670bc Avoid implementation defined behavior in a test.
Summary:
num_put::put uses %p for pointer types, but the exact format of %p is
implementation defined behavior for the C library. Compare output to
snprintf for portability.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: cfe-commits

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

llvm-svn: 293926
2017-02-02 19:44:11 +00:00
Asiri Rathnayake e396d8e260 Extend XFAIL to c++98.
NFC.

llvm-svn: 293881
2017-02-02 11:56:26 +00:00
Marshall Clow 6f033f0c30 Fix up some no-exception compile failures
llvm-svn: 293623
2017-01-31 13:12:32 +00:00
Alex Lorenz 143b58577d Workaround new -Wshadow warning introduced by r293599
llvm-svn: 293619
2017-01-31 12:37:48 +00:00