summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure bitset's string constructor doesn't poison the overload set.Eric Fiselier2019-07-011-0/+13
| | | | llvm-svn: 364842
* Add a missing '__uncvref_t' to the SFINAE constraints for optional's ↵Marshall Clow2019-06-271-0/+12
| | | | | | assignment operator. Fixes PR38638. Thanks to Jonathan Wakely for the report llvm-svn: 364574
* Fix test failures due to modified wording in Clang diagnostics.Richard Smith2019-06-242-4/+4
| | | | llvm-svn: 364241
* Fix test failures when using a custom ABI namespace.Richard Smith2019-06-241-1/+1
| | | | llvm-svn: 364239
* Use C++11 implementation of unique_ptr in C++03.Eric Fiselier2019-06-231-4/+0
| | | | llvm-svn: 364161
* Implement P0340R3: Make 'underlying_type' SFINAE-friendly. Reviewed as ↵Marshall Clow2019-06-212-20/+106
| | | | | | https://reviews.llvm.org/D63574 llvm-svn: 364094
* Use rvalue references throughout the is_constructible traits.Eric Fiselier2019-06-213-6/+3
| | | | llvm-svn: 364065
* Make move and forward work in C++03.Eric Fiselier2019-06-216-102/+29
| | | | | | | | | | | | | | | | | | | | | These functions are key to allowing the use of rvalues and variadics in C++03 mode. Everything works the same as in C++11, except for one tangentially related case: struct T { T(T &&) = default; }; In C++11, T has a deleted copy constructor. But in C++03 Clang gives it both a move and a copy constructor. This seems reasonable enough given the extensions it's using. The other changes in this patch were the minimal set required to keep the tests passing after the move/forward change. Most notably the removal of the `__rv<unique_ptr>` hack that was present in an attempt to make unique_ptr move only without language support. llvm-svn: 364063
* Enable aligned_union in C++03Eric Fiselier2019-06-211-2/+0
| | | | llvm-svn: 364058
* Get is_convertible tests passing in C++03 (except the fallback).Eric Fiselier2019-06-212-8/+3
| | | | llvm-svn: 364057
* Make rvalue metaprogramming traits work in C++03.Eric Fiselier2019-06-219-23/+0
| | | | | | The next step is to get move and forward working in C++03. llvm-svn: 364053
* [libc++] Recommit r363692 to implement P0608R3Zhihao Yuan2019-06-204-3/+207
| | | | | | | | | | | | Re-apply the change which was reverted in r363764 as-is after breakages being resolved. Thanks Eric Fiselier for working hard on this. See also: https://bugs.llvm.org/show_bug.cgi?id=42330 Differential Revision: https://reviews.llvm.org/D44865 llvm-svn: 363993
* [libc++] Revert r363692 which implements P0608R3Zhihao Yuan2019-06-194-207/+3
| | | | | | | The change caused a large number of compiler failures in Google's codebase. People need time to evaluate the impact. llvm-svn: 363764
* [libc++] Implement P0608R3 - A sane variant converting constructorZhihao Yuan2019-06-184-3/+207
| | | | | | | | | | | | | | | | | | Summary: Prefer user-defined conversions over narrowing conversions and conversions to bool. References: http://wg21.link/p0608 Reviewers: EricWF, mpark, mclow.lists Reviewed By: mclow.lists Subscribers: zoecarver, ldionne, libcxx-commits, cfe-commits, christof Differential Revision: https://reviews.llvm.org/D44865 llvm-svn: 363692
* [libc++] Re-apply XFAIL to is_base_of test that was inadvertently revertedLouis Dionne2019-06-181-4/+5
| | | | llvm-svn: 363689
* [libc++] Revert the addition of map/multimap CTADLouis Dionne2019-06-181-2/+1
| | | | | | | | | | | | | 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 llvm-svn: 363688
* Add tests for LWG 3206. NFCMarshall Clow2019-06-171-0/+23
| | | | llvm-svn: 363589
* Move libc++ specific tests for std::function out of the std directoryEric Fiselier2019-06-112-94/+0
| | | | llvm-svn: 363111
* XFAIL a couple of tests on apple-clang-9.1, which is a compiler that I ↵Marshall Clow2019-06-111-1/+2
| | | | | | didn't know existed llvm-svn: 363097
* Add a test for is_base_of and incomplete types. Because this trait uses a ↵Marshall Clow2019-06-111-0/+92
| | | | | | compiler intrinsic which was broken in many clangs, have lots of XFAILs. llvm-svn: 363029
* [libc++] Fix leading zeros in std::to_charsZhihao Yuan2019-06-101-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | 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: https://github.com/llvm-mirror/libcxx/blob/1f60111b597e5cb80a4513ec86f79b7e137f7793/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 llvm-svn: 362967
* Fix some incorrect std::function testsEric Fiselier2019-06-081-2/+4
| | | | llvm-svn: 362861
* [libcxx][test] Include test_workarounds.h where neededLouis Dionne2019-06-052-0/+2
| | | | | | | | | | | 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 llvm-svn: 362660
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-31397-0/+715
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Improve the test coverage for std::is_base_ofMarshall Clow2019-05-161-0/+15
| | | | llvm-svn: 360911
* Add a test for LWG#3204 and mark it as complete. Reviewed as ↵Marshall Clow2019-05-131-0/+33
| | | | | | https://reviews.llvm.org/D61829 Thanks to Zoe for the patch. llvm-svn: 360586
* Mark is_trivially_destructible as unsupported with apple-clang-9Nico Weber2019-05-031-0/+1
| | | | | | See discussion on https://reviews.llvm.org/D48292 llvm-svn: 359907
* Support overaligned types in `aligned_storage`.Eric Fiselier2019-04-301-0/+8
| | | | | | | | | | | | | | | | | 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 llvm-svn: 359596
* add tuple_cat test for const TEric Fiselier2019-04-261-6/+6
| | | | llvm-svn: 359256
* Fix return type of std::tuple_cat.Eric Fiselier2019-04-261-0/+15
| | | | | | | | | | | | When the arguments to tuple cat were const, the const was incorrectly propagated into the type of the resulting tuple. For example: const std::tuple<int> t(42); auto r = std::tuple_cat(t, t); // Incorrect! should be std::tuple<int, int>. static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>); llvm-svn: 359255
* [libc++][test] Fix noexcept assertions in variant's get testsCasey Carter2019-04-252-6/+14
| | | | | | | | | | All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+. Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers. Differential Revision: https://reviews.llvm.org/D61033 llvm-svn: 359220
* Update test to better check for the non-constexpr-ness of a move ↵Marshall Clow2019-04-251-5/+20
| | | | | | constructor. Fixes PR#41577. llvm-svn: 359162
* Use modern type trait implementations when available.Richard Smith2019-04-251-0/+6
| | | | | | | | | | | | | | Teach libcxx to stop using various deprecated __has_* type traits, in favor of the ("modern", C++11 era) __is_* type traits. This is mostly just a simplification, but fixes at least one bug: _Atomic T should be considered trivially-destructible, but is not considered to be POD by Clang, and __has_trivial_destructor is specified in the GCC documentation as returning false for non-POD non-class types. Differential Revision: https://reviews.llvm.org/D48292 llvm-svn: 359159
* Add std::is_constant_evaluated.Eric Fiselier2019-04-242-0/+79
| | | | | | | | | Clang recently added __builtin_is_constant_evaluated() and GCC 9.0 has it as well. This patch adds support for it in libc++. llvm-svn: 359119
* Make the test object callable. libstdc++'s bind checks that (libc++ ↵Marshall Clow2019-04-241-1/+1
| | | | | | currently does not). Thanks to Jonathan Wakely for the fix. llvm-svn: 359108
* Add an any_cast test for array types. Thanks to Jonathan Wakely for the ↵Marshall Clow2019-04-242-8/+25
| | | | | | suggestion. llvm-svn: 359085
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-052-9/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a re-application of r357533 and r357531. They had been reverted because we thought the commits broke the LLDB data formatters, but it turns out this was because only r357531 had been included in the CI run. Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. This effectively implements the wording in p1264r0. It hasn't been voted into the Standard yet, however there is wide agreement that the fix is correct and it's just a matter of time before the fix is standardized. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357775
* [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807Louis Dionne2019-04-031-2/+3
| | | | | | | Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58097 llvm-svn: 357616
* [libc++][NFC] Rename test file according to the libc++ conventionLouis Dionne2019-04-031-0/+58
| | | | llvm-svn: 357588
* Revert "[libc++] Fix error flags and exceptions propagated from input stream ↵Louis Dionne2019-04-022-50/+9
| | | | | | | | | | operations" This reverts commits r357533 and r357531, which broke the LLDB data formatters. I'll hold off until we know how to fix the data formatters accordingly. llvm-svn: 357536
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-022-9/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. I will submit a paper in San Diego to clarify the Standard such that the interpretation used in this commit (and other implementations) is the only possible one. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357531
* [libcxx] Make sure reference_wrapper works with incomplete typesLouis Dionne2019-04-014-0/+162
| | | | | | | | | | | | Summary: Completes P0357R3, which was merged into the C++20 Working Draft in San Diego. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54722 llvm-svn: 357423
* [libc++] Declare std::tuple_element as struct instead of classLouis Dionne2019-04-014-8/+4
| | | | | | | | | | | | Similarly to https://reviews.llvm.org/rL350972, this revision changes std::tuple_element from class to struct. Fixes PR41331. Thanks to Jan Wilken Dörrie for the patch. Differential Revision: https://reviews.llvm.org/D60069 llvm-svn: 357411
* Fix PR41130 - 'operator/ of std::chrono::duration and custom type'. Thanks ↵Marshall Clow2019-04-018-2/+127
| | | | | | to Zulan for the report, and Howard for the direction of the fix. llvm-svn: 357410
* Make common_type's implementation common Eric Fiselier2019-03-311-77/+98
| | | | | | | | | | | | | | | | | | | Summary: Currently the C++03 implementation of common_type has much different behavior than the C++11 one. This causes bugs, including inside `<chrono>`. This patch unifies the two implementations as best it can. The more code they share, the less their behavior can diverge. Reviewers: mclow.lists, ldionne, sbenza Reviewed By: mclow.lists, ldionne Subscribers: libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D59678 llvm-svn: 357370
* [libc++] Remove unnecessary <iostream> #includes in testsLouis Dionne2019-03-287-16/+4
| | | | | | | Some tests #include <iostream> but they don't use anything from the header. Those are probably artifacts of when the tests were developped. llvm-svn: 357181
* Reworked all the utilities/meta tests to use ASSERT_SAME_TYPE instead of ↵Marshall Clow2019-03-2827-153/+120
| | | | | | 'static_assert( is_same<'. Much easier to read. I left two tests alone: is_same.pass.cpp, which should call 'is_same' directly, and common_type.pass.cpp, which Eric is working on. NFC intended llvm-svn: 357146
* Cleaup of requirements for optional. While researching LWG3196, I realized ↵Marshall Clow2019-03-251-0/+47
| | | | | | that optional did not reject 'const in_place_t' like it should. Added a test as well, and a check for arrays (which were already disallowed, but now we get a better error message). Should not affect anyone's code. llvm-svn: 356918
* [libc++] Remove too-stringent XFAILs for file_clock testsLouis Dionne2019-03-213-4/+0
| | | | | | | Those tests actually pass because we don't use anything that's marked as unavailable. llvm-svn: 356719
* [libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't ↵Louis Dionne2019-03-213-12/+3
| | | | | | | | | support bad_any_cast With the latest compiler fix to availability, some availability failures that didn't trigger before now trigger. llvm-svn: 356678
OpenPOWER on IntegriCloud