Commit Graph

4099 Commits

Author SHA1 Message Date
Eric Fiselier
c80ef6ed28 Guard <experimental/coroutine> against older Clang versions.
Clang started providing -fcoroutines and defining __cpp_coroutines
way before it implemented the __builtin_coro_foo functions. This
means that simply checking if __cpp_coroutines is not a sufficient
way of detecting the actual feature.

This patch implements _LIBCPP_HAS_NO_COROUTINES which implements
a slightly more complex feature check. Specifically it requires
__cpp_coroutines >= 201703L, which only holds for Clang 5.0 built
after 2017/05/24.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 01:52:59 +00:00
Eric Fiselier
efcf07d44a Remove incorrect #ifdef guards around variant tests.
The tests were previously guarded by #if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER),
which is both incorrect (e.g. _LIBCPP_VERSION) and unneeded. Although the tests are
technically non-standard (yet) they are supported by both libc++ and MSVC's STL.

libstdc++ doesn't regularly use the test suite so I'm not concerned about guarding these
tests for them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 01:27:08 +00:00
Casey Carter
90b8e58ffa [test] Fix breakage from r303947 =(
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 01:00:56 +00:00
Casey Carter
fd6177ffd6 [test] make_shared<T()>(...) is, uh, libc++-specific
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 00:37:33 +00:00
Eric Fiselier
b3559ed0d6 Re-add <experimental/coroutine> to the module map.
The original issues were caused because <experimental/coroutine>
didn't correctly #ifdef out enough of the header, which caused incomplete
types to be used.

This patch fixes the `#if defined(__cpp_coroutines)` guard and re-adds
the headers to the module map.

It also uglifies some incorrectly non-reserved names.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 23:39:29 +00:00
Eric Fiselier
afb54769d4 Correct typo: LIBCXXABI_BUILTINS_LIBRARY -> LIBCXX_BUILTINS_LIBRARY
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 22:43:42 +00:00
Martell Malone
fa3bd28afb libcxx: fix bootstrapping for mingw-w64
Differential Revision: https://reviews.llvm.org/D33388

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 22:37:15 +00:00
Eric Fiselier
1bc177fd5b Update more coroutine_handle signatures to reflect N4663.
Thanks to Casey Carter for pointing out the out-of-date tests and
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 19:04:55 +00:00
Billy Robert O'Neal III
90c1331825 Add asserts that the nullptr is maintained in string erase operations.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 19:01:14 +00:00
Eric Fiselier
0b958696f5 Update coroutine_handle<P>::promise to reflect N4663.
This patch updates the promise() member to match the current spec.
Specifically it removes the non-const overload and make the return
type of the const overload non-const.

This patch also makes the ASSERT_NOT_NOEXCEPT tests libc++ specific,
since other implementations may be free to strengthen the specification.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 18:52:34 +00:00
Casey Carter
a42191c839 [test] Remove workaround for C1XX conversion-to-nullptr bug
VSO#391542 "Types can't be convertible to nullptr_t"

Also put internal bug numbers on the workarounds in test_workarounds.h for correlation.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 17:42:21 +00:00
Casey Carter
8b55cce1c8 [test] Workaround C1XX bug in uses_allocator_types.hpp
VSO#109062 "Explicit template argument specification with empty template parameter pack expansion does not imply further empty pack expansion"

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 17:42:17 +00:00
Erik Pilkington
3a07dd740b Fix a test that was failing in C++11 mode introduced in r303874
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 16:16:17 +00:00
Marshall Clow
8a80169b01 Mark LWG#2900 as complete - we already do this, and I checked the tests in a couple days ago (r303268 & r303824)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 16:05:54 +00:00
Erik Pilkington
a3e0bf4396 Add support for shared_ptr<FunctionType>
Fixes PR27566.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 15:43:31 +00:00
Marshall Clow
798ecd6c0f Last commit included some extra constexpr; remove them
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 14:20:26 +00:00
Marshall Clow
efae8792d8 Make for_each_n only avaliable on C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 13:40:57 +00:00
Eric Fiselier
eb6bf87030 Remove <experimental/coroutine> from the module map for now. It doesn't work unless modules are enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 05:30:05 +00:00
Eric Fiselier
d3f919eb7b Disable the coroutines tests until Clang bumps __cpp_coroutines to reflect recent changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 05:11:40 +00:00
Eric Fiselier
737c3bf25e Add <experimental/coroutine>
This patch adds the library portions of the coroutines PDTS,
which should now be supported by Clang.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 04:36:24 +00:00
Eric Fiselier
8392d4940d Fix broken links on C++1z status page
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 04:09:07 +00:00
Marshall Clow
10411c1626 Add non-parallel version of for_each_n (+tests) from the Parallelism TS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 02:29:54 +00:00
Marshall Clow
6d52b3b76c Add some constexpr tests for optional's move/copy ctor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 00:22:33 +00:00
Marshall Clow
a9197bd465 Implement LWG#2790: Remove istreambuf_iterator::operator->. It never did anything useful.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303675 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 18:55:32 +00:00
Erik Pilkington
64182a5877 [test] Add support for Objective-C++ tests
Differential revision: https://reviews.llvm.org/D33049

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-19 23:02:49 +00:00
Marshall Clow
9e6b540dad Make next/prev/advance/distance operations on iterators be constexpr. I missed this when I implemented the rest of P0031R0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 18:51:36 +00:00
Marshall Clow
6a5647485a Mark the copy constructor and move
constructor to be constexpr. This only works when the contained type has a constexpr copy/move ctor.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 15:30:01 +00:00
Casey Carter
fd1c7cb4b4 [test] Add specific test for P0138R2, direct-list-init of fixed enums from integers, part 3/3.
Test the C++17 Core Language feature independently from other std::byte tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 20:33:46 +00:00
Casey Carter
a17261169e [test] Avoid P0138R2, direct-list-init of fixed enums from integers, part 2/3.
This C++17 Core Language feature isn't necessary when testing std::byte.
It's a minor convenience, but it limits test coverage to very new compilers.

This part activates the tests for more compilers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 20:33:41 +00:00
Casey Carter
7e33af5858 [test] Avoid P0138R2, direct-list-init of fixed enums from integers, part 1/3.
This C++17 Core Language feature isn't necessary when testing std::byte.
It's a minor convenience, but it limits test coverage to very new compilers.

This part changes the code.

Fixes D32386.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302944 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 20:33:32 +00:00
Eric Fiselier
db15e80b33 Fix C++03 test failures caused by static_assert emulation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 03:53:56 +00:00
Eric Fiselier
e250cc68ce Cleanup test issues reported by STL @ Microsoft.
This patch cleans up a number of issues reported by STL, including:

1) Fix duplicate is_convertible test.
2) Move non-standard reference_wrapper tests under test/libcxx
3) Fix assumption that sizeof(wchar_t) == 32 in the codecvt and
   wstring_convert tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 03:38:28 +00:00
Eric Fiselier
050bf66723 Remove non-standard basic_string_view::clear() member.
This patch removes the clear() member from <string_view>. The
modifier was removed from the TS before it ever landed in the standard.
There is no reason libc++ should be providing this method.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 03:35:53 +00:00
Eric Fiselier
8e7fc5f6b3 Move POSIX specific test under test/libcxx subdirectory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 02:02:09 +00:00
Eric Fiselier
b22e6987b8 Move tests for libc++ configurations into libcxx/ test subdirectory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 01:49:32 +00:00
Eric Fiselier
2d31e197db Fix or move tests with non-standard assumptions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 01:44:51 +00:00
Eric Fiselier
40e4fb68ac Guard usage of libc++ regex internals inside test.
This patch attempts to make lookup_classname.pass.cpp usable against
other STL implementations by guarding the use of __regex_word. That being
said it seems likely that the test is still non-conforming due to how
libc++ handles the "w" character class.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 01:19:01 +00:00
Eric Fiselier
a12fdedd50 Fix XFAIL to reflect recent fixes in GCC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 23:04:04 +00:00
Marshall Clow
83c266a94f Mark LWG#2782 as complete. No functionality change; we already do this. Just added a few more tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302802 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 14:25:45 +00:00
Marshall Clow
8fdc890aeb Replace a nested namespace used for overload resolution with a struct. Richard Smith says that using the namespace results in an ODR violation, but I disagree. Nevertheless, the struct works just as well.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302800 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 14:00:54 +00:00
Marshall Clow
4cbf03ea88 Mark LWG#2850 as complete. No functionality change; we had tests that covered it already. Just added comments to the tests. Thanks to K-ballo for the heads up.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 13:55:20 +00:00
Marshall Clow
8fdd8117a9 Mark LWG#2796 as complete. No functionality change; we had tests that covered it already. Just added comments to the tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 13:51:09 +00:00
Michael Park
f318b708ef Fix std::visit for the zero variants case.
Summary:
The following code is broken:

```
    std::visit([]{});
```

Reviewers: EricWF

Reviewed By: EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 07:17:12 +00:00
Eric Fiselier
98e4596f65 Workaround -W#warnings on Windows until the correct fixes can land
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302743 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 23:29:13 +00:00
Eric Fiselier
ab2f54f103 Remove usages of _LIBCPP_MSVC which is never defined
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 21:40:58 +00:00
Eric Fiselier
2df956f21e Fix MinGW build to use Pthread when the header is available.
Some MinGW configurations use WinPThread instead of the native
threading interfaces. When this happens libc++ doesn't build because
it tries to use the wrong threading API.

This patch attempts to correctly detect and enable pthreads; Selecting
them when __MINGW32__ is defined and __has_include(<pthread.h>) is true.
I'm not sure if this works correctly 100% of the time but it seemed
like the most correct approach available.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 21:34:58 +00:00
Eric Fiselier
ca91fd09f7 Don't interfere with the __builtin_foo namespace under MSVC
This patch follows up on feedback received in the review for
D32988. Specifically that libc++ should not mess with the
__builtin namespace, and that libc++ should use __popcnt to implement
__pop_count under MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 21:30:04 +00:00
Billy Robert O'Neal III
5f3d5935a3 Fix bad #endif in msvc_stdlib_force_include.hpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 20:58:30 +00:00
Eric Fiselier
41af64afad [libc++] Refactor Windows support headers.
Summary:
This patch refactors and tries to remove as much of the Windows support headers as possible. This is needed because they currently introduce super weird include cycles and dependencies between STL and libc headers.

The changes in this patch are:

* remove `support/win32/support.h` completely. The required parts have either been moved into `support/win32/msvc_support.h` (for `MSVC` only helpers not needed by Clang), or directly into their respective `foo.h` headers.

* Combine `locale_win32.h` and `locale_mgmt_win32.h` into a single headers, this header should only be included within `__locale` or `locale` to avoid include cycles.

* Remove the unneeded parts of `limits_win32.h` and re-name it to `limits_msvc_win32.h` since it's only needed by Clang.

I've tested this patch using Clang on Windows, but I suspect it might technically regress our non-existent support for MSVC. Is somebody able to double check?

This refactor is needed to support upcoming fixes to `<locale>` on Windows.



Reviewers: bcraig, rmaprath, compnerd, EricWF

Reviewed By: EricWF

Subscribers: majnemer, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 20:57:45 +00:00
Eric Fiselier
76515a2dcf Implement LWG 2591 - Patch from K-Ballo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 20:37:43 +00:00