summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* Update -verify test to use new static assert messageEric Fiselier2016-09-251-5/+0
| | | | llvm-svn: 282352
* [libc++] Remove various C++03 feature test macrosEric Fiselier2016-09-2518-56/+57
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Libc++ still uses per-feature configuration macros when configuring for C++11. However libc++ requires a feature-complete C++11 compiler so there is no reason to check individual features. This patch starts the process of removing the feature specific macros and replacing their usage with `_LIBCPP_CXX03_LANG`. This patch removes the __config macros: * _LIBCPP_HAS_NO_TRAILING_RETURN * _LIBCPP_HAS_NO_TEMPLATE_ALIASES * _LIBCPP_HAS_NO_ADVANCED_SFINAE * _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS * _LIBCPP_HAS_NO_STATIC_ASSERT As a drive I also changed our C++03 static_assert to use _Static_assert if available. I plan to commit this without review if nobody voices an objection. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24895 llvm-svn: 282347
* Fix a few static_asserts that need extra parens on -03Marshall Clow2016-09-243-6/+6
| | | | llvm-svn: 282343
* Implement proposed resolution for LWG#2758. Reviewed as D24446. Normally, I ↵Marshall Clow2016-09-245-6/+13928
| | | | | | would wait for these to be voted upon at a committee meeting (November), but the current draft standard is broken, and this should fix it. (And if it doesn't, we want to know about it soonest) llvm-svn: 282342
* Fix incorrect include in is_error_code_enum.pass.cppMarshall Clow2016-09-241-2/+2
| | | | llvm-svn: 282332
* Implement is_error_code_v and is_error_condition_v for c++17. Rework the ↵Marshall Clow2016-09-244-1/+132
| | | | | | tests for is_error_code and is_error_condition, since they were really lacking. Thanks to Alisdair for the heads-up that we were missing these. llvm-svn: 282331
* Fix failure on 03 botMarshall Clow2016-09-221-2/+2
| | | | llvm-svn: 282134
* Add missing _v traits. is_bind_expression_v, is_placeholder_v and ↵Marshall Clow2016-09-223-8/+38
| | | | | | uses_allocator_v llvm-svn: 282126
* [libcxx] Add missing c++98 xfail. NFC.Asiri Rathnayake2016-09-161-1/+1
| | | | | | This is the only test failing in c++98 mode at the moment. llvm-svn: 281731
* [libcxx] Add a TSan regression test for a data race in call_onceKuba Brecka2016-09-141-0/+48
| | | | | | Differential Revision: https://reviews.llvm.org/D24297 llvm-svn: 281477
* Avoid compile error by giving the test type a user defined default constructorEric Fiselier2016-09-071-1/+1
| | | | llvm-svn: 280780
* Fix PR#30303 - no matching function for call to '__ptr_in_range'Marshall Clow2016-09-074-0/+40
| | | | llvm-svn: 280779
* Improve constexpr tests for std::anyEric Fiselier2016-09-071-9/+9
| | | | llvm-svn: 280777
* Fix PR30260 - optional<const T> not working.Eric Fiselier2016-09-078-0/+94
| | | | | | | | | | This patch fixes PR30260 by using a (void*) cast on the placement argument to placement new to casts away the const. See also http://llvm.org/PR30260. As a drive by change this patch also changes the header guard for <experimental/optional> to _LIBCPP_EXPERIMENTAL_OPTIONAL from _LIBCPP_OPTIONAL. llvm-svn: 280775
* Fix Bug 30240 - std::string: append(first, last) error when aliasing. Add ↵Marshall Clow2016-09-0512-0/+193
| | | | | | test cases for append/insert/assign/replace while we're at it, and fix a similar bug in insert. llvm-svn: 280643
* Apply curr_symbol.pass.cpp test fix to missed test caseEric Fiselier2016-09-041-1/+6
| | | | llvm-svn: 280612
* Fix bad locale test data when using the newest glibcEric Fiselier2016-09-041-0/+8
| | | | llvm-svn: 280608
* Mark test as XFAIL for C++03, rather than providing a dummy pass.Marshall Clow2016-09-041-5/+2
| | | | llvm-svn: 280605
* Fix PR30202 - notify_all_at_thread_exit seg faults if run from a raw pthread ↵Eric Fiselier2016-09-031-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | context. Summary: This patch allows threads not created using `std::thread` to use `std::notify_all_at_thread_exit` by ensuring the TL state has been initialized within `std::notify_all_at_thread_exit`. Additionally this patch "fixes" a potential oddity in `__thread_local_pointer::reset(pointer)`, which would previously delete the old thread local data. However there should *never* be old thread local data because pthread *should* null it out on thread exit. Unfortunately it's possible that pthread failed to do this according to the spec: > > Upon key creation, the value NULL shall be associated with the new key in all active threads. Upon thread creation, the value NULL shall be associated with all defined keys in the new thread. > > An optional destructor function may be associated with each key value. At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key, the value of the key is set to NULL, and then the function pointed to is called with the previously associated value as its sole argument. The order of destructor calls is unspecified if more than one destructor exists for a thread when it exits. > > If, after all the destructors have been called for all non-NULL values with associated destructors, there are still some non-NULL values with associated destructors, then the process is repeated. If, after at least {PTHREAD_DESTRUCTOR_ITERATIONS} iterations of destructor calls for outstanding non-NULL values, there are still some non-NULL values with associated destructors, implementations may stop calling destructors, or they may continue calling destructors until no non-NULL values with associated destructors exist, even though this might result in an infinite loop. However if pthread fails to delete the value it is probably incorrect for us to do it. Destroying the value performs all of the "at thread exit" actions registered with it but we are way past "at thread exit". Reviewers: mclow.lists, bcraig, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24159 llvm-svn: 280588
* Add "FLAKY_TEST" test directive to support re-running flaky tests.Eric Fiselier2016-08-3015-0/+30
| | | | | | | | Some of the mutex tests fail on machines with high load. This patch implements the test directive "// FLAKY_TEST" which allows a test to be run 3 times before it's considered a failure. llvm-svn: 280050
* Fix pair::operator=(TupleLike&&).Eric Fiselier2016-08-291-0/+140
| | | | | | | | | | | This assignment operator was previously broken since the SFINAE always resulted in substitution failure. This caused assignments to turn into copy construction + assignment. This patch was originally committed as r279953 but was reverted due to warnings in the test-suite. This new patch corrects those warnings. llvm-svn: 279955
* Revert r279953 - Fix pair::operator=(TupleLike&&)Eric Fiselier2016-08-291-135/+0
| | | | | | | The test emits warnings causing the test-suite to fail. Since I want this patch merged into 3.9 I'll recommit it with a clean test. llvm-svn: 279954
* Fix pair::operator=(TupleLike&&).Eric Fiselier2016-08-291-0/+135
| | | | | | | | This assignment operator was previously broken since the SFINAE always resulted in substitution failure. This caused assignments to turn into copy construction + assignment. llvm-svn: 279953
* Implement C++17 std::sample.Eric Fiselier2016-08-284-3/+249
| | | | | | | | This patch implements the std::sample function added to C++17 from LFTS. It also removes the std::experimental::sample implementation which now forwards to std::sample. llvm-svn: 279948
* Mark LWG 2716 as complete - shuffle and sample disallows lvalue URNGs.Eric Fiselier2016-08-283-10/+13
| | | | | | | | | | | Libc++'s implementation of shuffle and sample already support lvalue and rvalue RNG's. This patch adds tests for both categories and marks the issue as complete. This patch also contains drive-by change for std::experimental::sample which improves the diagnostics produced when the correct iterator categories are not supplied. llvm-svn: 279947
* Implement LWG 2711. Constrain path members.Eric Fiselier2016-08-284-0/+194
| | | | llvm-svn: 279945
* Add missing include that caused a test failure on Windows. Thanks to STL for ↵Marshall Clow2016-08-221-0/+1
| | | | | | the patch. No functional change. llvm-svn: 279453
* make the associative containers do the right thing for ↵Marshall Clow2016-08-171-0/+158
| | | | | | propogate_on_container_assignment. Fixes bug #29001. Tests are only for <map> right now - more complete tests will come when we revamp our allocator testing structure. llvm-svn: 279008
* Support allocators with explicit conversion constructors. Fixes bug #29000Marshall Clow2016-08-1738-3/+975
| | | | llvm-svn: 278904
* libcxx: Fix path.compare.pass expected resultAdhemerval Zanella2016-08-151-6/+10
| | | | | | | | | | | | | | | | | | | The expected 'filesystem::path::compare' result states that for different path only result sign contains the information about passed arguments (not its integer value). This is due it uses the output of other compare functions (basic_string_view and char_traits) without further handling and char_traits uses memcmp for final buffer comparison. However for GLIBC on AArch64 the code: int ret = memcmp ("b/a/c", "a/b/c", 1); Results in '64' where for x86_64 it results in '1'. This patch fixes the expected 'filesystem::path::compare' by normalizing all the results before assert comparison. llvm-svn: 278745
* Remove test for the sign of a NaN - doesn't work on MIPS, not strictly ↵Marshall Clow2016-08-111-1/+0
| | | | | | legal. Fixes bug 28936 llvm-svn: 278387
* test: relax the FS test a slight bit to be more reliableSaleem Abdulrasool2016-08-111-1/+2
| | | | | | | | | Some filesystems track atime always. This relaxes the test to accept either a filesystem which does not accurately track atime or does track the atime accurately. This allows the test to pass on filesystems mounted with `strictatime` on Linux or on macOS. llvm-svn: 278357
* Unbreak C++03 build.Eric Fiselier2016-08-111-1/+1
| | | | llvm-svn: 278323
* Refactor test archetypes implementation.Eric Fiselier2016-08-116-68/+74
| | | | llvm-svn: 278319
* [libcxx] Add std::anyEric Fiselier2016-08-1134-13/+2501
| | | | | | | | | | | | | | | | | | | Summary: This patch adds std::any by moving/adapting <experimental/any>. This patch also implements the std::any parts of p0032r3 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf) and LWG 2509 (http://cplusplus.github.io/LWG/lwg-defects.html#2509). I plan to push it in a day or two if there are no comments. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22733 llvm-svn: 278310
* Implement LWG 2148: Make non-enum default hash specialization well-formedEric Fiselier2016-08-102-5/+40
| | | | | | | | | | | | | | | | | Summary: This patch removes the static_assert for non-enum types in the primary hash template. Instead non-enum types create a hash<T> specialization that is not constructible nor callable. See also: * http://cplusplus.github.io/LWG/lwg-active.html#2543 * https://llvm.org/bugs/show_bug.cgi?id=28917 Reviewers: mclow.lists, EricWF Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D23331 llvm-svn: 278300
* std:: quailfy the calls for cend/crend/cbegin/cend. Fixes bug 28927.Marshall Clow2016-08-101-0/+51
| | | | llvm-svn: 278282
* test/hard_link_count(): Fix test on darwinMatthias Braun2016-08-101-8/+17
| | | | | | | The hard link count that stat reports are different between normal hfs and the case sensitive variant. Accept both. llvm-svn: 278191
* [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctorHubert Tong2016-08-071-0/+39
| | | | | | | | | | | | | | | | | | | | | | Summary: The synopsis in C++11 subclause 28.8 [re.regex] has: ``` basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); ``` The default argument is added to libc++ by this change. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22702 Reapplies r277966. Patch by Jason Liu! llvm-svn: 277968
* Revert r277966. Forgot patch attribution.Hubert Tong2016-08-071-39/+0
| | | | llvm-svn: 277967
* [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctorHubert Tong2016-08-071-0/+39
| | | | | | | | | | | | | | | | | | | Summary: The synopsis in C++11 subclause 28.8 [re.regex] has: ``` basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); ``` The default argument is added to libc++ by this change. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22702 llvm-svn: 277966
* Fix compile error due to mismatched iterator types. Patch from STL@microsoft.comEric Fiselier2016-08-031-1/+1
| | | | llvm-svn: 277574
* Fix an MSVC x64 compiler warning. Patch from STL@microsoft.comEric Fiselier2016-08-033-9/+12
| | | | llvm-svn: 277573
* [libcxx] basic_regex: add traits_type, string_typeHubert Tong2016-08-021-0/+6
| | | | | | | | | | | | | | | | | Summary: In the synopsis in C++11 subclause 28.8 [re.regex], `basic_regex` is specified to have member typedefs `traits_type` and `string_type`. This change adds them to libc++. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22698 Patch by Jason Liu! llvm-svn: 277526
* Implement LCM and GCD for C++17. Same code as for Library Fundamentals TS.Marshall Clow2016-07-266-0/+359
| | | | llvm-svn: 276751
* Implement LCM and GCD for Library Fundamentals. Reviewed as ↵Marshall Clow2016-07-268-0/+389
| | | | | | https://reviews.llvm.org/D21343. llvm-svn: 276750
* Remove use of C++1z static assert in C++11 testEric Fiselier2016-07-251-8/+8
| | | | llvm-svn: 276608
* Implement the std::pair parts of "Improving pair and tuple". Completes N4387.Eric Fiselier2016-07-259-35/+668
| | | | llvm-svn: 276605
* Recommit r276548 - Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-255-2/+334
| | | | | | | I think I've solved issues with is_assignable and references to incomplete types. The updated patch adds tests for this case. llvm-svn: 276603
* Make std::is_assignable tolerate references to incomplete types.Eric Fiselier2016-07-251-2/+5
| | | | llvm-svn: 276599
OpenPOWER on IntegriCloud