summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement LWG 3013 - some filesystem members should not be noexcept.Eric Fiselier2017-10-306-21/+32
| | | | | | | | | | | | | | | LWG 3013 points out that the constructors and increment members of the directory iterators need to allocate, and therefore cannot be marked noexcept. It also points out that `is_empty` and `copy` likely need to allocate as well, and as such can also not be noexcept. This patch speculatively implements the resolution removing noexcept, because libc++ does indeed have the possibility of throwing on allocation failure. llvm-svn: 316941
* Fix PR35078 - recursive directory iterator's increment method throws ↵Eric Fiselier2017-10-301-0/+246
| | | | | | | | | | | | | | incorrectly. The guts of the increment method for recursive_directory_iterator was failing to pass an error code object to calls to status/symlink_status, which can throw under certain conditions. This patch fixes the issues by correctly propagating the error codes. However the noexcept still needs to be removed from the signature, as mentioned in LWG 3014, but that change will be made in a separate commit. llvm-svn: 316939
* Mark test as unsupported on C++98/03, since it uses move_iteratorMarshall Clow2017-10-301-0/+2
| | | | llvm-svn: 316917
* Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis ↵Marshall Clow2017-10-301-0/+44
| | | | | | Yaroshevskiy for both the bug report and the fix. llvm-svn: 316914
* Mark string_view's constructor from (ptr,len) as noexcept (an extension). ↵Marshall Clow2017-10-244-3/+15
| | | | | | Update the tests to check this (and other noexcept bits llvm-svn: 316456
* Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K ↵Marshall Clow2017-10-241-0/+6
| | | | | | for the bug report. llvm-svn: 316439
* Fix an unsigned integer overflow in regex that lead to a bad memory access. ↵Marshall Clow2017-10-191-0/+1
| | | | | | Found by OSS-Fuzz llvm-svn: 316191
* Fix UB - signed integer overflow in regex. Thanks to Tim Shen for the patch. ↵Marshall Clow2017-10-191-0/+40
| | | | | | Reviewed as https://reviews.llvm.org/D39066 llvm-svn: 316172
* Fix regex bug with ^\W. Thanks to Tim Shen for the patch. Reviewed as ↵Marshall Clow2017-10-181-0/+29
| | | | | | https://reviews.llvm.org/D37955 llvm-svn: 316095
* [libc++] Fix PR34898 - vector iterator constructors and assign method ↵Eric Fiselier2017-10-177-66/+666
| | | | | | | | | | | | | | | | | | | | | | | perform push_back instead of emplace_back. Summary: The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy. This patch addresses the issue by correctly using `emplace_back` in C++11 and newer. There are also some bugs in our `insert` implementation, but those will be handled separately. @mclow.lists We should probably merge this into 5.1, agreed? Reviewers: mclow.lists, dlj, EricWF Reviewed By: mclow.lists, EricWF Subscribers: cfe-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D38757 llvm-svn: 315994
* Fix last_write_time.pass.cpp to work with clang-3.9 and earlierRoman Lebedev2017-10-151-0/+2
| | | | | | At least with clang-3.9 and earlier, -Wunknown-pragmas is also needed. llvm-svn: 315882
* Really do make sure that last_write_time.pass.cpp still works with old clangRoman Lebedev2017-10-151-2/+6
| | | | | | | I *did* try to check that such kind of an issue was not introduced by the rL315874, but clearly i failed to finish verification. llvm-svn: 315876
* Silence clang's -Wtautological-constant-compare in last_write_time.pass.cppRoman Lebedev2017-10-151-0/+22
| | | | | | | Previously this broke the builders, when D38101 was committed. Silence the warning so that it can be re-landed. llvm-svn: 315874
* Placate unused variable warnings uncovered by improvements to clang's ↵Benjamin Kramer2017-10-1418-0/+25
| | | | | | -Wunused-variable llvm-svn: 315809
* Mark test as a long-testRoger Ferrer Ibanez2017-10-121-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D38452 llvm-svn: 315570
* Remove unneeded typename from testRoger Ferrer Ibanez2017-10-102-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D38628 llvm-svn: 315278
* [libc++] Support Microsoft ABI without vcruntime headersShoaib Meenai2017-10-093-0/+3
| | | | | | | | | | | | | | | | | The vcruntime headers are hairy and clash with both libc++ headers themselves and other libraries. libc++ normally deals with the clashes by deferring to the vcruntime headers and silencing its own definitions, but for clients which don't want to depend on vcruntime headers, it's desirable to support the opposite, i.e. have libc++ provide its own definitions. Certain operator new/delete replacement scenarios are not currently supported in this mode, which requires some tests to be marked XFAIL. The added documentation has more details. Differential Revision: https://reviews.llvm.org/D38522 llvm-svn: 315234
* Fix accidental assignment inside test assertsEric Fiselier2017-10-042-2/+2
| | | | llvm-svn: 314947
* Add C++17 explicit deduction guides to std::pair.Eric Fiselier2017-10-042-3/+84
| | | | | | | This patch adds the newly standardized deduction guides for std::pair, allowing it to work class template deduction. llvm-svn: 314864
* [test] Allow other implementations to strengthen noexcept on deque's move ↵Casey Carter2017-09-301-1/+1
| | | | | | constructor llvm-svn: 314608
* [test] forwardlist.cons/move_noexcept.pass.cppCasey Carter2017-09-281-1/+1
| | | | | | * Don't forbid non-libc++ implementations from strengthening noexcept on forward_list's move constructor. llvm-svn: 314459
* [libcxx] [test] Fix unused local typedef warnings.Stephan T. Lavavej2017-09-261-2/+2
| | | | llvm-svn: 314259
* [libcxx] [test] Strip trailing whitespace.Stephan T. Lavavej2017-09-261-1/+1
| | | | llvm-svn: 314258
* Fix two failing -verify tests to tolerate old and new clang versionsEric Fiselier2017-09-172-5/+5
| | | | llvm-svn: 313502
* Fix failing -verify tests due to change in Clangs static_assert message.Eric Fiselier2017-09-179-38/+38
| | | | | | | | Clang recently changed the way it outputs static assert diagnostics. This patch fixes libc++'s -verify tests so they tolerate both the old and new message format. llvm-svn: 313499
* Fix accidental ADL in std::allocator_traits meta-programming.Eric Fiselier2017-09-158-0/+84
| | | | | | | | | | | There were a number of cases where __double_underscore functions, for example __has_construct_test, were called without being qualified, causing ADL to occur. This patch qualifies those calls to avoid this problem. Thanks to David L. Jones for point out the issue initially. llvm-svn: 313324
* Mark the new tests as unsupported when there are no exceptionsMarshall Clow2017-09-122-2/+4
| | | | llvm-svn: 313092
* XFAIL a couple of new <regex> tests for C++03Marshall Clow2017-09-122-0/+2
| | | | llvm-svn: 313064
* Apply D28224: 'Throw exception after too many steps' Fixes PR#20291. Thanks ↵Marshall Clow2017-09-122-0/+92
| | | | | | to Tim Shen for the patch llvm-svn: 313056
* Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - ↵Marshall Clow2017-09-121-0/+41
| | | | | | thanks to Jonathan Wakely for the report llvm-svn: 313031
* Add include of <string> to <system_error>, since things in there return ↵Marshall Clow2017-09-112-0/+21
| | | | | | strings. Fixes PR#34529. llvm-svn: 312923
* Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier2017-09-101-1/+36
| | | | | | | | | | | | | This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312892
* Revert "Fix PR34298 - Allow std::function with an incomplete return type."Eric Fiselier2017-09-101-36/+1
| | | | | | | | | | | This reverts commit r312890 because the test case fails to compile for older versions of Clang that reject initializing a const object without a user defined constructor. Since this patch should go into 5.0.1, I want to keep it an atomic change, and will re-commit it with a fixed test case. llvm-svn: 312891
* Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier2017-09-101-1/+36
| | | | | | | | | | | | | This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312890
* XFAIL tests on SLES11Brian Cain2017-09-083-0/+3
| | | | | | | XFAIL some failing tests for SLES11 (older glibc), also replace spaces in linux distro w/dashes. llvm-svn: 312774
* Add even more string_view tests. These found some bugs in the default ↵Marshall Clow2017-09-078-0/+1416
| | | | | | parameter value for rfind/find_last_of/find_last_not_of llvm-svn: 312693
* Another missing string_view testMarshall Clow2017-09-071-0/+74
| | | | llvm-svn: 312691
* Add more string_view testsMarshall Clow2017-09-073-0/+909
| | | | llvm-svn: 312690
* [test] Cleanup nullopt_t testsCasey Carter2017-08-313-44/+14
| | | | | | | | | | | | | | * Update specification text from N4387 * Delete not_brace_initializable.fail.cpp: it's redundant with nullopt_t.fail.cpp * is_empty<T> implies is_class<T> * is_literal is deprecated; directly verify that we can create a nullopt_t in a constexpr context Differential Revision: D37024 llvm-svn: 312256
* Fix test for C++03Marshall Clow2017-08-291-3/+4
| | | | llvm-svn: 311967
* Fix PR31166: std::inplace_merge seems to be unstable. Thanks to Jan Wilken ↵Marshall Clow2017-08-281-0/+21
| | | | | | Dörrie for the suggested fix. llvm-svn: 311952
* [libcxx] [test] Update for C++17 feature removals.Stephan T. Lavavej2017-08-2414-13/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/std/containers/Emplaceable.h test/std/containers/NotConstructible.h test/support/counting_predicates.hpp Replace unary_function/binary_function inheritance with typedefs. test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp test/std/utilities/function.objects/func.require/binary_function.pass.cpp test/std/utilities/function.objects/func.require/unary_function.pass.cpp Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function. test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support. test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp This test doesn't need to be skipped in C++17 mode. Only the construction of std::function from an allocator needs to be skipped in C++17 mode. test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp When testing these reference_wrapper features, unary_function inheritance is totally irrelevant. test/std/utilities/function.objects/refwrap/weak_result.pass.cpp Define and use my_unary_function/my_binary_function to test the weak result type machinery (which is still present in C++17, although deprecated). test/support/msvc_stdlib_force_include.hpp Now we can test C++17 strictly, without enabling removed features. Fixes D36503. llvm-svn: 311705
* [libcxx] [test] Rename _Up to U, etc. NFCI.Stephan T. Lavavej2017-08-115-18/+18
| | | | | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. This performs additional de-uglification, so all of these tests follow the example of iterator.traits/empty.pass.cpp. llvm-svn: 310761
* [libcxx] [test] Rename __x to x. NFCI.Stephan T. Lavavej2017-08-114-25/+26
| | | | | | | This improves readability and (theoretically) improves portability, as __ugly names are reserved. llvm-svn: 310760
* [libcxx] [test] Rename __c to ch. NFCI.Stephan T. Lavavej2017-08-1137-148/+148
| | | | | | | This improves readability and (theoretically) improves portability, as __ugly names are reserved. llvm-svn: 310759
* [libcxx] [test] Rename _Tp to T. NFCI.Stephan T. Lavavej2017-08-1122-72/+72
| | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. llvm-svn: 310758
* [libcxx] [test] Untabify stringstream.cons/string.pass.cpp. NFC.Stephan T. Lavavej2017-08-051-6/+6
| | | | llvm-svn: 310157
* [libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.Stephan T. Lavavej2017-08-057-7/+7
| | | | llvm-svn: 310156
* [libcxx] [test] Consistently list "c++98, c++03" in chronological order. NFC.Stephan T. Lavavej2017-08-0516-16/+16
| | | | llvm-svn: 310155
* Fix shadowing warningMarshall Clow2017-08-021-1/+1
| | | | llvm-svn: 309851
OpenPOWER on IntegriCloud