summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* Wrote my own version of is_permutation; that was dominating the timingsMarshall Clow2018-01-191-8/+62
| | | | llvm-svn: 322920
* Add memory trackingMarshall Clow2018-01-181-1/+84
| | | | llvm-svn: 322872
* Use high_resolution_clock instead of steady_clock. Also now builds with gcc ↵Marshall Clow2018-01-181-2/+3
| | | | | | 7.2 (for comparison purposes) llvm-svn: 322864
* A simple program for testing OSS-Fuzz test cases locally.Marshall Clow2018-01-181-0/+111
| | | | llvm-svn: 322863
* Update Google Benchmark libraryEric Fiselier2018-01-1877-2625/+4886
| | | | llvm-svn: 322812
* Fix most GCC test failures.Eric Fiselier2018-01-186-15/+61
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes almost all currently failing tests when using GCC ToT. The specific changes are: (A) Workaround gcc.gnu.org/PR83921 which rejects variables w/o initializers in constexpr contexts -- even when the variable is an empty class. This bug has been worked around at all callsites by adding an initializer. Additionally a new test, constexpr_init.pass.cpp, has been added to test that Clang doesn't suffer from these bugs. (B) Fix streambuf.assign/swap.pass.cpp. This test was never actually calling the swap method as intended. In fact, the swap function it intended to call was ill-formed when instantiated. GCC diagnosed this ill-formedness w/o needing an instantiation. (C) size_delete11.pass.cpp was fixed by adding c++2a to the list of unsupported dialects. llvm-svn: 322810
* libcxx: Define set_unexpected, _get_unexpected and __uncaught_exceptions ↵Peter Collingbourne2018-01-181-3/+3
| | | | | | | | | | | | without dllimport. It turns out that the MSVC headers define these functions without dllimport even when compiling with /MD. This change fixes the resulting compile-time error. Differential Revision: https://reviews.llvm.org/D42207 llvm-svn: 322794
* Fix nodiscard failure tests on compilers w/o -verify.Eric Fiselier2018-01-172-2/+13
| | | | | | | | | | | | | Previously .fail.cpp tests for nodiscard were run with -Wunused-result being a warning, not an error, when the compiler didn't support -verify. When -verify isn't enabled this change judiciously adds -Werror=unused-result when to only the failure tests containing the // expected-error string for nodiscard. As a drive-by change, this patch also adds a missing // UNSUPPORTED: c++2a to a test which was only supposed to run in C++ <= 11. llvm-svn: 322776
* libcxx: Disable CFI in function std::get_temporary_buffer.Peter Collingbourne2018-01-171-0/+1
| | | | | | | | | The specification of this function mandates a cast to uninitialized T*, which is forbidden under CFI. Differential Revision: https://reviews.llvm.org/D42146 llvm-svn: 322744
* libcxx: Stop using private MSVC macros in the exception implementation.Peter Collingbourne2018-01-173-43/+23
| | | | | | | | | | | Inline the provided "fallback" definitions (which seem to always be taken) that expand to __cdecl into users. The fallback definitions for the *CRTIMP* macros were wrong in the case where the CRT is being linked statically, so define our own macro as a replacement. Differential Revision: https://reviews.llvm.org/D42158 llvm-svn: 322617
* More constexpr algorithms from P0202. search/search_nMarshall Clow2018-01-167-26/+101
| | | | llvm-svn: 322566
* Change an internal table of constants for the poisson distribution fromMarshall Clow2018-01-161-1/+1
| | | | | | | | | type 'result_type' to 'double'. The only thing that we ever do with these numbers is to promote them to 'double' and use them in a division. For small result_types, the values were getting truncated, skewing the results. Thanks to James Nagurne for the suggestion. llvm-svn: 322556
* More constexpr algorithms from P0202: lower_bound, upper_bound, equal_range, ↵Marshall Clow2018-01-1611-43/+176
| | | | | | binary_search llvm-svn: 322529
* Actually CALL the constexpr tests.Marshall Clow2018-01-162-0/+8
| | | | llvm-svn: 322528
* More constexpr (re P0202) - equal and mismatchMarshall Clow2018-01-165-22/+164
| | | | llvm-svn: 322527
* Fix constexpr failure on C++11-based buildbots.Marshall Clow2018-01-151-1/+1
| | | | llvm-svn: 322507
* More constexpr from P0202. count and count_if. Also fix a comment that ↵Marshall Clow2018-01-153-10/+39
| | | | | | Morwenn noted. llvm-svn: 322506
* Some of the tests from earlier today had 'int' as the return type when it ↵Marshall Clow2018-01-1515-15/+15
| | | | | | should have been 'bool'. Fix that. It doesn't change the behavior of any of the tests, but it's more accurate. llvm-svn: 322505
* More P0202 constexpr-ifying. All the find_XXX algorithms in this commit.Marshall Clow2018-01-1510-32/+210
| | | | llvm-svn: 322504
* partition_point gets the P0202 treatmentMarshall Clow2018-01-154-6/+23
| | | | llvm-svn: 322493
* More constexpr algorithms from P0202. any_of/all_of/none_of.Marshall Clow2018-01-154-9/+54
| | | | llvm-svn: 322492
* First part of P0202: Adding constexpr modifiers to functions in <algorithm> ↵Marshall Clow2018-01-1513-62/+222
| | | | | | and <utility>. This commit is all the is_XXX algorithms. llvm-svn: 322489
* Add error code handling to remove_all testEkaterina Vaartis2018-01-121-1/+1
| | | | | | As mentioned by EricWF in revision D41830 llvm-svn: 322351
* [libcxx] Make std::basic_istream::get 0-terminate input array in case of error.Volodymyr Sapsai2018-01-113-1/+128
| | | | | | | | | | | | | | | | | | | It covers the cases when the sentry object returns false and when an exception was thrown. Corresponding standard paragraph is C++14 [istream.unformatted]p9: [...] In any case, if n is greater than zero it then stores a null character into the next successive location of the array. rdar://problem/35566567 Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40677 llvm-svn: 322326
* Implement an _is_allocator type trait for use in deduction guides.Marshall Clow2018-01-112-0/+51
| | | | llvm-svn: 322306
* Fix some too-big local arrays. Thanks to dcdillon for the patch. Reviewed as ↵Marshall Clow2018-01-111-2/+2
| | | | | | D28217 llvm-svn: 322295
* Make std::experimental::filesystem::remove and remove_all return false or 0 ↵Ekaterina Vaartis2018-01-113-7/+38
| | | | | | | | if the file doesn't exist Differential Revision: https://reviews.llvm.org/D41830 llvm-svn: 322293
* libcxx: Stop providing a definition of __GLIBC_PREREQ.Peter Collingbourne2018-01-101-5/+7
| | | | | | | | | | | An application may determine whether the C standard library is glibc by testing whether __GLIBC_PREREQ is defined. This breaks if libc++ provides its own definition. Instead, define our own macro in our namespace with the desired semantics. Differential Revision: https://reviews.llvm.org/D41892 llvm-svn: 322201
* Fix misspelled macro name - thanks to andrew@ispras.ru for the catchMarshall Clow2018-01-101-1/+1
| | | | llvm-svn: 322196
* [libcxx] [test] Improve MSVC portability.Stephan T. Lavavej2018-01-103-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | test/support/msvc_stdlib_force_include.hpp When testing MSVC's STL with C1XX, simulate a couple more compiler feature-test macros. When testing MSVC's STL, simulate a few library feature-test macros. test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp The vector_size attribute is a non-Standard extension that's supported by Clang and GCC, but not C1XX. Therefore, guard this with `__has_attribute(vector_size)`. Additionally, while these tests pass when MSVC's STL is compiled with Clang, I don't consider this to be a supported scenario for our library, so also guard this with defined(_LIBCPP_VERSION). test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp N4713 23.14.10 [func.not_fn]/1 depicts only `call_wrapper(call_wrapper&&) = default;` and `call_wrapper(const call_wrapper&) = default;`. According to 15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable. Therefore, guard the assignability tests as libc++ specific. Add a (void) cast to tolerate not_fn() being marked as nodiscard. Fixes D41213. llvm-svn: 322144
* [libcxx] Support the use of compiler-rt in lit testsPetr Hosek2018-01-083-1/+5
| | | | | | | | Don't link tests against libgcc when compiler-rt is being used. Differential Revision: https://reviews.llvm.org/D40513 llvm-svn: 322044
* Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."Dan Albert2018-01-081-1/+1
| | | | | | | | | Seems to have broken some tests since I first wrote this a while back. Will reland after checking what went wrong with the tests. This reverts commit 7023194c8d11a081fd01ed25308b3d60193c6a06. llvm-svn: 322039
* Apparently 'C++14' is different than 'c++14'Marshall Clow2018-01-081-1/+1
| | | | llvm-svn: 322034
* Make rehash(0) work with ubsan's unsigned-integer-overflow.Dan Albert2018-01-081-1/+1
| | | | | | | | | | | | Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40743 llvm-svn: 322031
* Change add_ten to add_one to avoid triggering ubsan integer overflow.Billy Robert O'Neal III2018-01-083-67/+67
| | | | llvm-svn: 322021
* Add the C++17 extensions to std::search. Include the default searcher, but ↵Marshall Clow2018-01-0814-82/+1414
| | | | | | not the Boyer-Moore or Boyer-Moore-Horspool searcher (yet). BUT put the BM and BMH tests in place, marked to XFAIL. The other searchers will follow soon llvm-svn: 322019
* Document upcoming TS feature removalMarshall Clow2018-01-081-0/+138
| | | | llvm-svn: 322011
* Mark the transparent version set::count() as const. Thanks to Ivan Matek for ↵Marshall Clow2018-01-071-1/+1
| | | | | | the bug report. llvm-svn: 321966
* Add pre-C++11 is_constructible wrappers for 3 argumentsDimitry Andric2018-01-072-4/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After rL319736 for D28253 (which fixes PR28929), gcc cannot compile `<memory>` anymore in pre-C+11 modes, complaining: ``` In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ ``` This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc). The reason is that the static assertions are invoking `is_constructible` with three arguments, while gcc does not have the built-in `is_constructible` feature, and the pre-C++11 `is_constructible` wrappers in `<type_traits>` only provide up to two arguments. I have added additional wrappers for three arguments, modified the `is_constructible` entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: krytarowski, cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D41805 llvm-svn: 321963
* Correct mistake in pragma usage for WindowsSaleem Abdulrasool2018-01-061-2/+2
| | | | | | | The autolink pragma was missing the pragma name itself. This would result in the pragma being silently dropped. llvm-svn: 321937
* Add casts to prevent narrowing warnings.Billy Robert O'Neal III2018-01-063-6/+6
| | | | llvm-svn: 321923
* [libcxx] [test] Remove nonstandard things and resolve warnings in Xxx_scan testsBilly Robert O'Neal III2018-01-068-101/+98
| | | | | | | | | | | Reviewed as https://reviews.llvm.org/D41748 * These tests use function objects from functional, back_inserter from iterator, and equal from algorithm, so add those headers. * The use of iota targeting vector<unsigned char> with an int parameter triggers warnings on MSVC++ assigning an into a unsigned char&; so change the parameter to unsigned char with a static_cast. * Avoid naming unary_function in identity here as that is removed in '17. (This also fixes naming _VSTD, _NOEXCEPT_, and other libcxx-isms) * Change the predicate in the transform tests to add_ten so that problems with multiple application are caught. llvm-svn: 321922
* [cmake] Add a config option LIBCXX_HAS_WIN32_THREAD_API for enforcing win32 ↵Martin Storsjo2018-01-053-0/+24
| | | | | | | | | | | | | | | | threads This allows keeping libcxx using win32 threads even if a version of pthread.h is installed. This matches the existing cmake option LIBCXX_HAS_PTHREAD_API. Also add missing documentation about the internal define _LIBCPP_HAS_THREAD_API_WIN32. Differential Revision: https://reviews.llvm.org/D41764 llvm-svn: 321896
* Move + and * operators of MoveOnly into MoveOnly.h.Billy Robert O'Neal III2018-01-052-11/+2
| | | | llvm-svn: 321852
* Fix incorrect handling of move-only types in transform_reduce iter iter iter ↵Billy Robert O'Neal III2018-01-052-1/+23
| | | | | | init, and add test. llvm-svn: 321851
* Automated trailing whitespace removal by VS Code.Billy Robert O'Neal III2018-01-051-18/+18
| | | | llvm-svn: 321850
* Add move-only types test to transform_reduce iter iter iter init op op.Billy Robert O'Neal III2018-01-051-0/+14
| | | | llvm-svn: 321849
* Add move-only types test for transform_reduce bop/uop.Billy Robert O'Neal III2018-01-051-0/+13
| | | | llvm-svn: 321848
* Fix nonstandard bits in transform_reduce_iter_iter_init_bop_uop.Billy Robert O'Neal III2018-01-051-43/+27
| | | | | | | | * _VSTD should be std. * <utility> is needed for forward. * unary_function is no longer standard (and unnecessary for this, a C++17-only test) llvm-svn: 321847
* Update version to 7.0.0svn: cmake, include files and docsHans Wennborg2018-01-034-5/+5
| | | | llvm-svn: 321725
OpenPOWER on IntegriCloud