summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* Add entry to CREDITS.TXT for propagate_constJonathan Coe2016-06-191-0/+4
| | | | llvm-svn: 273123
* Implement std::experimental::propagate_const from LFTS v2Jonathan Coe2016-06-1944-0/+2135
| | | | | | | | | | | | | Summary: An implementation of std::experimental::propagate_const from Library Fundamentals Technical Specification v2. No tests are provided for disallowed types like fancy pointers or function pointers as no code was written to handle these. Reviewers: EricWF, mclow.lists Differential Revision: http://reviews.llvm.org/D12486 llvm-svn: 273122
* Test commit; remove some spaces at EOL. No functional change.Marshall Clow2016-06-191-3/+3
| | | | llvm-svn: 273121
* Fix various undefined behavior found by UBSan.Eric Fiselier2016-06-196-24/+45
| | | | | | | | | | | | | | | | | | | | | | | * Fix non-null violation in strstream.cpp Overflow was calling memcpy with a null parameter and a size of 0. * Fix std/atomics/atomics.flag/ tests: a.test_and_set() was reading from an uninitialized atomic, but wasn't using the value. The tests now clear the flag before performing the first test_and_set. This allows UBSAN to test that clear doesn't read an invalid value. * Fix std/experimental/algorithms/alg.random.sample/sample.pass.cpp The tests were dereferencing a past-the-end pointer to an array so that they could do pointer arithmetic with it. Instead of dereference the iterator I changed the tests to use the special 'base()' test iterator method. * Add -fno-sanitize=float-divide-by-zero to suppress division by zero UBSAN diagnostics. The tests that cause float division by zero are explicitly aware that they are doing that. Since this is well defined for IEEE floats suppress the warnings for now. llvm-svn: 273107
* Implement LWG issue 1169. num_get not fully compatible with strto*Eric Fiselier2016-06-197-9/+130
| | | | | | | | | | | Use strtof and strtod for floats and doubles respectively instead of always using strtold. The other parts of the change are already implemented in libc++. This patch also has a drive by fix to wbuffer_convert::underflow() which prevents it from calling memmove(buff, null, 0). llvm-svn: 273106
* Add UBSan blacklist for <__tree> and <__hash_table>Eric Fiselier2016-06-192-1/+6
| | | | | | | | | | | We all know <__tree> and <__hash_table> have plenty of UB that UBSan faithfully finds. I am working on fixing this. However the noisy output from these failures prevent automatically detecting regressions elsewhere. This patch adds a blacklist file for these failures so I can later set up a UBSAN buildbot. llvm-svn: 273104
* Fix bugs in last_write_time implementation.Eric Fiselier2016-06-192-40/+145
| | | | | | | | | | | | | | | * Fix passing a negative number as either tv_usec or tv_nsec. When file_time_type is negative and has a non-zero sub-second value we subtract 1 from tv_sec and make the sub-second duration positive. * Detect and report when 'file_time_type' cannot be represented by time_t. This happens when using large/small file_time_type values with a 32 bit time_t. There is more work to be done in the implementation. It should start to use stat's st_mtim or st_mtimeval if it's provided as an extension. That way we can provide a better resolution. llvm-svn: 273103
* Remove Apple specific guard for utimensat. Use !defined(UTIME_OMIT) instead.Eric Fiselier2016-06-181-5/+4
| | | | | | | As pointed out by @majnemer this is a better way to detect utimensat on all platforms. The Apple specific guard is unneeded. llvm-svn: 273093
* Add -Wno-covered-switch-default while compiling libc++Eric Fiselier2016-06-181-0/+1
| | | | | | | | fstream has a switch over ios_base::seekdir which provides a defensive default case. This seems like the right thing for fstream to do, but we need to disable clangs warning during the build to allow this. llvm-svn: 273092
* Fix SleepFor(...) helper when a monotonic clock is not available.Eric Fiselier2016-06-181-3/+7
| | | | | | | | Single threaded builds often don't provide a monotonic clock, so we can't always provide a monotonic SleepFor(...) implementation. Hopefully this won't cause the builds to hang. llvm-svn: 273091
* Use monotonic clock in synthetic SleepFor test helperEric Fiselier2016-06-181-2/+2
| | | | llvm-svn: 273089
* Use utimes instead of utimensat when !defined(UTIME_OMIT). Fixes build for ↵Eric Fiselier2016-06-181-1/+3
| | | | | | older GLIBC versions llvm-svn: 273088
* Fix 3 bugs in filesystem tests and implementation.Eric Fiselier2016-06-184-40/+41
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following bugs, all of which were discovered while testing a 32 bit build on a 64 bit machine. * path.itr/iterator.pass.cpp has undefined behavior. 'path::iterator' stashes the value of the element inside the iterator. This violates the BiDirIterator requirements but is allowed for path::iterator. However this means that using reverse_iterator<path::iterator> has undefined behavior because it assumes that 'Iter tmp = it; return *tmp' will not create a dangling reference. However it does, and this caused this particular test to fail. * path.native.obs/string_alloc.pass.cpp tested the SSO with a long string. On 32 bit builds std::wstring only has the SSO for strings of size 2. The test was using a string of size 4. * fs.op.space/space.pass.cpp had overflows while calculating the expected values. The fix here is to convert the statvfs data members to std::uintmax_t before multiplying them. The internal implementation already does this but the tests needed to do it as well. llvm-svn: 273078
* Enable building and using atomic shared_ptr for GCC.Eric Fiselier2016-06-182-6/+5
| | | | | | | | | | | | | | | | | Summary: Currently the implementation of [util.smartptr.shared.atomic] is provided only when using Clang, and not with GCC. This is a relic of not having a GCC implementation of <atomic>, even though <atomic> isn't actually used in the implementation. This patch enables support for atomic shared_ptr functions when using GCC. Note that this is not a header only change. Previously only Clang builds of libc++.so would provide the required symbols. There is no reason for this restriction. After this change both Clang and GCC builds should be binary compatible with each other WRT these symbols. Reviewers: mclow.lists, rmaprath, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21407 llvm-svn: 273076
* Add additional tests in an attempt to diagnose ARM test failures.Eric Fiselier2016-06-184-14/+65
| | | | | | | | | | | | | | | | | | | | | | | | | Currently 4 tests are failing on the ARM buildbot. To try and diagnose each of the failures this patch does the following: 1) path.itr/iterator.pass.cpp * Temporarily print iteration sequence to see where its failing. 2) path.native.obs/string_alloc.pass.cpp * Remove test that ::new is not called when constructing a short string that requires a conversion. Since during the conversion global locale objects might be constructed. 3) fs.op.funcs/space.pass.cpp * Explicitly use uintmax_t in the implementation of space, hopefully preventing possible overflows. * Add additional tests that check for overflow is the calculation of the space_info values. * Add additional tests for the values returned from statfvs. 4) fs.op.funcs/last_write_time.pass.cpp * No changes made yet. llvm-svn: 273075
* Add checkpoints to string allocation test to help with debugging arm failures.Eric Fiselier2016-06-181-1/+6
| | | | llvm-svn: 273072
* Fix bugs in recursive_directory_iterator::increment(ec) implementation and ↵Eric Fiselier2016-06-172-18/+23
| | | | | | | | | | | | | | | tests. r273060 didn't completely fix the issues in recursive_directory_iterator and the tests. This patch follows up with more fixes * Fix bug where recursive_directory_iterator::increment(ec) did not reset the error code if no failure occurred. * Fix bad assertion in the recursive_directory_iterator::increment(ec) test that would only fire for certain iteration orders. llvm-svn: 273070
* Work around GCC bug in tests. The bug has been fixed in GCC 6.0Eric Fiselier2016-06-171-2/+2
| | | | llvm-svn: 273068
* Fix initialization of test case array in C++11Eric Fiselier2016-06-171-1/+3
| | | | llvm-svn: 273065
* Fix bugs in recursive_directory_iterator implementation and tests.Eric Fiselier2016-06-173-24/+48
| | | | | | | | | | | There are two fixes in this patch: * Fix bug where the constructor of recursive_directory_iterator did not reset the error code if no failure occurred. * Fix tests were dependent on the iteration order of the test directories. llvm-svn: 273060
* Get filesystem tests passing for single-threaded configurations.Eric Fiselier2016-06-177-14/+14
| | | | llvm-svn: 273054
* Update status of filesystem issues, and add tests for LWG issue 2683Eric Fiselier2016-06-172-22/+22
| | | | llvm-svn: 273051
* Reorder permissions test so they are not dependent on the processes umaskEric Fiselier2016-06-171-4/+4
| | | | llvm-svn: 273049
* Respect the processes umask in the create_directory testEric Fiselier2016-06-171-9/+11
| | | | llvm-svn: 273048
* Add missing space between >> in template declaration. Fixes C++03 build.Eric Fiselier2016-06-171-1/+1
| | | | llvm-svn: 273037
* Fix a couple of warnings present in the filesystem tests.Eric Fiselier2016-06-173-4/+16
| | | | llvm-svn: 273035
* Add Filesystem TS -- CompleteEric Fiselier2016-06-17147-11/+15301
| | | | | | | | | | | | | | Add the completed std::experimental::filesystem implementation and tests. The implementation supports C++11 or newer. The TS is built as part of 'libc++experimental.a'. Users of the TS need to manually link this library. Building and testing the TS can be disabled using the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'. Currently 'libc++experimental.a' is not installed by default. To turn on the installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'. llvm-svn: 273034
* Remove CloudABI specific workaround.Ed Schouten2016-06-161-2/+0
| | | | | | | | CloudABI has gained the mblen_l() function in the meantime that does properly return whether the character set has shift-states (read: never). llvm-svn: 272886
* Add an Android version check for GNU strerror_r.Dan Albert2016-06-151-1/+6
| | | | | | | | | | | | | | | | Summary: Android didn't gain GNU's strerror_r until Marshmallow. If we're building libc++ against something older (we build the NDK library against the oldest release we support, currently Gingerbread), fall back to the POSIX version. Reviewers: mclow.lists, EricWF Subscribers: tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D21402 llvm-svn: 272827
* Fix warning in tuple tests. The test suite should now run clean with most ↵Eric Fiselier2016-06-151-8/+3
| | | | | | warnings enabled llvm-svn: 272822
* Add -Wno-unused-command-line-argument when running the test suite to prevent ↵Eric Fiselier2016-06-151-0/+1
| | | | | | errors llvm-svn: 272809
* Fix const default initialization of lock_guard<>Eric Fiselier2016-06-151-1/+1
| | | | llvm-svn: 272804
* [libcxx] [test] In test/support/test_allocator.h, fix construct() to avoid ↵Eric Fiselier2016-06-151-11/+12
| | | | | | | | | | | | | | | | | moving immovable types. Summary: In test/support/test_allocator.h, fix construct() to avoid moving immovable types. This improves the allocator's conformance, and fixes compiler errors with MSVC's STL. The scenario is when the allocator is asked to construct an object of type X that's immovable (deleted copy/move ctors), but implicitly constructible from an argument type A. When perfectly forwarded, X can be (explicitly) constructed from A, and everything is fine. That's std::allocator's behavior, and the Standard's default when a user allocator's construct() doesn't exist. The previous implementation of construct() here mishandled this scenario. Passing A to this construct() would implicitly construct an X temporary, bound to (non-templated) T&&. Then construct() would attempt to move-construct X from that X temporary, but X is immovable, boom. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21094 llvm-svn: 272747
* Improve portability of random_device tests. Patch from STL@microsoft.comEric Fiselier2016-06-152-2/+6
| | | | llvm-svn: 272746
* Improve portability of vector tests. Patch from STL@microsoft.comEric Fiselier2016-06-151-1/+1
| | | | llvm-svn: 272745
* Improve portability of hash tests. Patch from STL@microsoft.comEric Fiselier2016-06-152-6/+10
| | | | llvm-svn: 272744
* Automatically detect export lists for OS X.Eric Fiselier2016-06-141-1/+15
| | | | | | | | | | | | | | | | | | Summary: Libc++ reexports symbols from the system libc++abi using -reexport_symbols_list. This can cause a linker failure if the list contains symbols not defined in the system libc++abi. This patch attempts to detect the OS X version and use it to determine the correct symbol list. It's my understanding that `lib/libc++abi2.exp` should be used on 10.9 and greater. Otherwise 'lib/libc++abi.exp' should be used This fixes PR25666 (https://llvm.org/bugs/show_bug.cgi?id=25666) Reviewers: mclow.lists, bcraig, dexonsmith, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20772 llvm-svn: 272723
* Fix bad test that was previously getting ifdef-ed awayEric Fiselier2016-06-141-2/+2
| | | | llvm-svn: 272722
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-14827-988/+1085
| | | | | | | | | TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
* Found a couple bugs in the test suite. No functionality change.Marshall Clow2016-06-143-2/+6
| | | | llvm-svn: 272679
* Partially Revert r272613. FreeBSD needs the non-trivial constructors in pair.Eric Fiselier2016-06-142-8/+28
| | | | llvm-svn: 272671
* Update errcat.objects tests so they test the bug fixed in r272640.Eric Fiselier2016-06-142-6/+11
| | | | llvm-svn: 272642
* Fix syntax error in r272640.Eric Fiselier2016-06-141-1/+2
| | | | llvm-svn: 272641
* Fix error checking for strerror_r implementations that return the error code.Eric Fiselier2016-06-141-2/+4
| | | | llvm-svn: 272640
* Avoid octal escape sequence warning with MSVC. Patch from STL@microsoft.comEric Fiselier2016-06-142-3/+3
| | | | llvm-svn: 272639
* Add missing includeEric Fiselier2016-06-141-0/+2
| | | | llvm-svn: 272638
* Temporarily XFAIL variadic lock_guard mangling test for GCC 4.9Eric Fiselier2016-06-141-1/+5
| | | | llvm-svn: 272637
* Implement variadic lock_guard.Eric Fiselier2016-06-1413-32/+550
| | | | | | | | | | | | | | | | | | | | Summary: This patch implements the variadic `lock_guard` paper. Making `lock_guard` variadic is a ABI breaking change because the specialization `lock_guard<_Mutex>` mangles differently then when it was the primary template. This change only provides variadic `lock_guard` in ABI V2 or when `_LIBCPP_ABI_VARIADIC_LOCK_GUARD` is defined. Note that in ABI V2 `lock_guard` must always be declared as a variadic template, even in C++03, in order to keep the ABI consistent. For this reason `lock_guard` is forward declared as a variadic template in all standard dialects and therefore depends on variadic templates being provided as an extension in C++03. All supported versions of Clang and GCC provide this extension. Reviewers: mclow.lists Subscribers: K-ballo, mclow.lists, cfe-commits Differential Revision: http://reviews.llvm.org/D21260 llvm-svn: 272634
* Make system_error::message() thread safe. Fixes PR25598.Eric Fiselier2016-06-143-1/+71
| | | | | | | | | | | | | | | | | | | | Summary: system_error::message() uses `strerror` for the generic and system categories. This function is not thread safe. The fix is to use `strerror_r`. It has been available since 2001 for GNU libc and since BSD 4.4 on FreeBSD/OS X. On platforms with GNU libc the extended version is used which always returns a valid string, even if an error occurs. In single-threaded builds `strerror` is still used. See https://llvm.org/bugs/show_bug.cgi?id=25598 Reviewers: majnemer, mclow.lists Subscribers: erik65536, cfe-commits, emaste Differential Revision: http://reviews.llvm.org/D20903 llvm-svn: 272633
* Ignore depricated warnings from <ext/hash_map> and <ext/hash_set>Eric Fiselier2016-06-142-0/+10
| | | | llvm-svn: 272632
OpenPOWER on IntegriCloud