Commit Graph

3131 Commits

Author SHA1 Message Date
Louis Dionne
11aae354b9 [libc++] Revert the addition of map/multimap CTAD
This was found to be broken on Clang trunk. This is a revert of the
following commits (the subsequent commits added XFAILs to the tests
that were missing from the original submission):

    r362986: Implement deduction guides for map/multimap.
    r363014: Add some XFAILs
    r363097: Add more XFAILs
    r363197: Add even more XFAILs

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363688 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-18 14:40:15 +00:00
Marshall Clow
a5a011702c Add tests for LWG 3206. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363589 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 18:06:30 +00:00
Eric Fiselier
cd4a856d45 add header to help with template testing
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363503 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-15 21:16:57 +00:00
Louis Dionne
f6244f8e57 [libcxx] Add XFAIL for facet test when back-deploying to older macOS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363405 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 14:40:38 +00:00
Louis Dionne
ead1950731 [libc++] Add missing #include in <cwchar> tests
Thanks to Mikhail Maltsev for the patch.
Differential Revision: https://reviews.llvm.org/D63289

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363290 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-13 18:24:28 +00:00
Louis Dionne
d7020fb087 [libcxx] XFAIL set/multiset CTAD tests on Apple Clang 10
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363209 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 22:01:05 +00:00
Louis Dionne
3939b1c7e7 [libcxx] XFAIL some CTAD tests on AppleClang 10
AppleClang 10 doesn't contain some changes that are required for this
test to give the right error message.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363197 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 20:12:44 +00:00
Eric Fiselier
704a388bb7 Move libc++ specific tests for std::function out of the std directory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363111 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 22:59:53 +00:00
Eric Fiselier
d011bdc437 Add documentation and tests for Clangs C++11 extensions in C++03.
As we gear up to drop support for GCC in C++03, we should make clear
what our C++03 mode is, the C++11 extensions it provides,
and the C++11 extensions it depends on.

The section of this document discussing user-facing extensions has
been left blank while the community discusses new directions. For now
it's just a warning to users.

Additionally, the document contains examples of how these extensions
should be used and why. For example, using alias templates over class
templates.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363110 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 22:53:49 +00:00
Louis Dionne
5a3290673c [libcxx] Mark CTAD tests for set and multiset as unsupported on older Apple Clangs
Those fail on Green Dragon.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363107 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 22:36:20 +00:00
Marshall Clow
35a718a2c5 Mark CTAD fail tests for set/multiset as XFAIL for older compilers that give different error messages
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363099 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 20:35:19 +00:00
Marshall Clow
88b46e4a16 XFAIL a couple of tests on apple-clang-9.1, which is a compiler that I didn't know existed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363097 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 20:14:07 +00:00
Eric Fiselier
20e25e0079 Check in test that demonstrates ABI break for std::function.
Our C++03 and C++11 implementations of function are not ABI
compatible. I've added a "test" that demonstrates this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363092 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 18:41:47 +00:00
Louis Dionne
19430da69d [libc++] Implement deduction guides for <set>
This is part of C++17's P0433.

Thanks to Arthur O'Dwyer for the patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363090 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 18:21:08 +00:00
Louis Dionne
a67757da87 [libcxx] Make std::tuple<> trivially constructible
Summary:
This is not mandated by the Standard, but it's nonetheless a nice
property to have, especially since it's so easy to implement. It
also shrinks our bug list!

PR41714

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363075 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 15:02:10 +00:00
Louis Dionne
4211451486 [libcxx] Slightly improved policy for handling experimental features
Summary:
Following the discussion on the libcxx-dev mailing list
(http://lists.llvm.org/pipermail/libcxx-dev/2019-May/000358.html),
this implements the new policy for handling experimental features and
their deprecation. We basically add a deprecation warning for
std::experimental::filesystem, and we remove a bunch of <experimental/*>
headers that were now empty.

Reviewers: mclow.lists, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits, jfb

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363072 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 14:48:40 +00:00
Marshall Clow
dbcfe75325 Add a test for is_base_of and incomplete types. Because this trait uses a compiler intrinsic which was broken in many clangs, have lots of XFAILs.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363029 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 03:38:29 +00:00
Marshall Clow
6b83993a22 XFAIL a couple of CTAD tests on clang-6; it gives different error messages than clang 7/8/9
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363014 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 00:23:50 +00:00
Marshall Clow
49ae262e74 Implement deduction guides for map/multimap. Reviewed as https://reviews.llvm.org/D58587. Thanks to Quuxplusone for the submission.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362986 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 21:28:23 +00:00
Zhihao Yuan
5a466fcca7 [libc++] Fix leading zeros in std::to_chars
Summary:
It is a bugfix proposal for https://bugs.llvm.org/show_bug.cgi?id=42166.

`std::to_chars` appends leading zeros if input 64-bit value has 9, 10 or 11 digits.
According to documentation `std::to_chars` must not append leading zeros:
https://en.cppreference.com/w/cpp/utility/to_chars

Changeset should not affect `std::to_chars` performance:
http://quick-bench.com/CEpRs14xxA9WLvkXFtaJ3TWOVAg

Unit test that `std::from_chars` supports compatibility for both `std::to_chars` outputs (previous and fixed one) already exists:
1f60111b59/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp (L63)

Reviewers: lichray, mclow.lists, ldionne, EricWF

Reviewed By: lichray, mclow.lists

Subscribers: zoecarver, christof, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362967 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 17:11:46 +00:00
Eric Fiselier
5db0997bf6 Fix some incorrect std::function tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362861 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 00:45:45 +00:00
Louis Dionne
0a3564fc0b [libcxx][test] Include test_workarounds.h where needed
Some tests require `TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT`, but they
did not include the header that defines that macro.

Thanks to Michael Park for the patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362660 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-05 21:54:34 +00:00
Louis Dionne
e5294f1da1 [libcxx] Add test to check min/max requirement to regular expression
This commit adds tests that repeated characters in regular expressions
are within numeric limits, and that a <= b in a regex like `x{a,b}`.

Thanks to Andrey Maksimov for the patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362525 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-04 16:47:18 +00:00
Marshall Clow
84231264b5 No longer reject inputs when using a locale that has grouping information _and_ the input has no grouping characters at all. We continue to reject cases when the input has grouping characters in the wrong place. Fixes PR#28704
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362508 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-04 15:18:46 +00:00
Marshall Clow
b6e011b18b Add include for 'test_macros.h' to all the tests that were missing them. Thanks to Zoe for the (big, but simple) patch. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362252 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 18:35:30 +00:00
Louis Dionne
98c565c88c [libcxx] Add regex test cases from PR40904
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362115 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-30 16:53:05 +00:00
Marshall Clow
58320bef19 Add additional constraints on midpoint(pointer, pointer). Fixes PR#42037.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361970 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-29 15:17:55 +00:00
Marshall Clow
a7056dbb65 Fix test that used raw string literals. Doesn't work in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361894 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 23:13:55 +00:00
Marshall Clow
feb0e9afd4 Fix an incorrect 'Throws' in the regex code. Add a test for the new behavior. Reviewed as https://reviews.llvm.org/D61828. Thanks to Mark for the catch and the fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361887 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 22:42:32 +00:00
Eric Fiselier
bfea7307ae fix test for older clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361594 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 03:15:32 +00:00
Eric Fiselier
57436c8125 fix destroying delete test with older apple compilers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361593 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 02:46:34 +00:00
Eric Fiselier
087c094fec P0722R3: Implement library support for destroying delete
Summary:
This provides the `std::destroying_delete_t` declaration in C++2a and after. (Even when the compiler doesn't support the language feature).

However, the feature test macro `__cpp_lib_destroying_delete` is only defined when we have both language support and  C++2a.


Reviewers: ldionne, ckennelly, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: dexonsmith, riccibruno, christof, jwakely, jdoerfert, mclow.lists, ldionne, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361572 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 23:46:44 +00:00
Louis Dionne
154d4dbd16 [libcxx][tests] Fix order checking in unordered_multiset tests.
Some tests assume that iteration through an unordered multiset elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch introduces checks verifying that any iteration will return
elements exactly from a set of valid values and without repetition,
but in no particular order.

Thanks to Andrey Maksimov for  the patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361494 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 13:11:00 +00:00
Louis Dionne
05c927e263 [libcxx][test] Fix order checking in some more unordered_multimap tests
Some tests assume that iteration through an unordered multimap elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch is a continuation of D54838 and introduces checks verifying that
any iteration will return elements exactly from a set of valid values
and without repetition, but in no particular order.

Thanks to Andrey Maksimov for the patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361414 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 18:10:32 +00:00
Marshall Clow
130106b216 Ensure that hash<basic_string> uses char_traits. Fixes PR#41876. Reviewed as https://reviews.llvm.org/D61954
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361201 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-20 21:56:51 +00:00
Eric Fiselier
a3dbe35fb2 Remove using namespace std; in __gnu_cxx namespace.
The `using namespace std;` opens us up to ambiguity
when any of the std:: names are also present in the global namespace.
Instead we should properly qualify names we use from std::.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361074 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-17 20:46:00 +00:00
Marshall Clow
7cfbabcb84 Improve the test coverage for std::is_base_of
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@360911 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-16 15:56:26 +00:00
Michal Gorny
549cc3d6e1 [libc++] [test] Use std::nextafter() instead of std::nexttoward()
Use std::nextafter() instead of std::nexttoward() in midpoint tests.
In the context of this test, this should not cause any difference.
Since nexttowardl() is not implemented on NetBSD 8, the latter function
combined with 'long double' type caused test failure.  nextafterl() does
not have this problem.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@360673 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-14 13:56:20 +00:00
Brian Cain
9a1483e2ec [libcxx] teach type_traits test about long uint32_t
Patch by Ben Craig.




git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@360590 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-13 15:41:18 +00:00
Marshall Clow
61ca0bbf14 Add a test for LWG#3204 and mark it as complete. Reviewed as https://reviews.llvm.org/D61829 Thanks to Zoe for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@360586 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-13 14:56:02 +00:00
Eric Fiselier
57a14161db force the bots to cycle
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@360306 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-09 02:34:37 +00:00
Nico Weber
6807ed9b23 Mark is_trivially_destructible as unsupported with apple-clang-9
See discussion on https://reviews.llvm.org/D48292

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359907 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 17:26:17 +00:00
Casey Carter
f16a595ec7 [libc++][test] Remove non-portable assumption that thread's constructor allocates with ::new
Drive-by:
* Fix potential race between check and update of `throw_one` in `operator new`
* Fix latent bug in `operator delete`, which shouldn't decrement `outstanding_new` when passed a null pointer
* Specifically catch the expected `bad_alloc` in `main` instead of `...`

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359827 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-02 21:19:41 +00:00
Dan Albert
c551aa9928 Add missing locale requirement to test.
Linux is failing even though the test runner does report this locale
is available, but the test still isn't expected to work on platforms
without the locale (like Android).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359726 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 21:02:32 +00:00
Dan Gohman
d6842df3f7 [WebAssembly] WASI support for libcxx
This adds explicit support for the WASI platform to libcxx.

WASI libc uses some components from musl, however it's not fully compatible
with musl, so we're planning to stop using _LIBCPP_HAS_MUSL_LIBC and
customize for WASI libc specifically.

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

Reviewers: sbc100, ldionne


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359703 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 16:47:30 +00:00
Marshall Clow
0c6eb81c47 Get rid of a bunch of 'unused variable' warnings in test when run with debug_level set. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359672 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 11:25:58 +00:00
Marshall Clow
3cae9fcd3d Fix a bunch of unordered container tests that were failing when _LIBCPP_DEBUG was set.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359642 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 01:52:51 +00:00
Eric Fiselier
35323b7f05 Support overaligned types in aligned_storage.
Summary:
The current implementation of aligned storage was written before we had `alignas`, so it used a list of builtin types to force the alignment. But this doesn't work overaligned requests.

This patch adds a fallback case supporting over-alignment. It only affects case that were previously ill-formed.

Reviewers: rsmith, ldionne, dlj, mclow.lists

Reviewed By: mclow.lists

Subscribers: mclow.lists, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359596 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 18:44:45 +00:00
Marshall Clow
cac04cde5e Implement LWG 2960: nonesuch is insufficiently useless
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359526 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 00:54:38 +00:00
Marshall Clow
732332686b Add tests specifically for LWG2164. We already did this; but now we have tests. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359458 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-29 15:38:07 +00:00