summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix some 'FIXME's in the tests.Marshall Clow2016-12-304-18/+10
| | | | llvm-svn: 290758
* Recommit r290750: Fix PR19460 - std::ios is convertible to int.Eric Fiselier2016-12-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two problems with the initial fix. 1. The added tests flushed out that we misconfigured _LIBCPP_EXPLICIT with GCC. 2. Because the boolean type was a member function template it caused weird link errors. I'm assuming due to the vague linkage rules. This time the bool type is a non-template member function pointer. That seems to have fixed the failing tests. Plus it will end up generating less symbols overall, since the bool type is no longer per instantiation. original commit message below ----------------------------- std::basic_ios has an operator bool(). In C++11 and later it is explicit, and only allows contextual implicit conversions. However explicit isn't available in C++03 which causes std::istream (et al) to have an implicit conversion to int. This can easily cause ambiguities when calling operator<< and operator>>. This patch uses a "bool-like" type in C++03 to work around this. The "bool-like" type is an arbitrary pointer to member function type. It will not convert to either int or void*, but will convert to bool. llvm-svn: 290754
* Revert r290750 - Fix PR19460 - std::ios is convertible to int.Eric Fiselier2016-12-301-9/+0
| | | | llvm-svn: 290752
* Add missing include in test.Eric Fiselier2016-12-301-0/+2
| | | | llvm-svn: 290751
* Fix PR19460 - std::ios is convertible to int.Eric Fiselier2016-12-301-0/+7
| | | | | | | | | | | | | | | std::basic_ios has an operator bool(). In C++11 and later it is explicit, and only allows contextual implicit conversions. However explicit isn't available in C++03 which causes std::istream (et al) to have an implicit conversion to int. This can easily cause ambiguities when calling operator<< and operator>>. This patch uses a "bool-like" type in C++03 to work around this. The "bool-like" type is an arbitrary pointer to member function type. It will not convert to either int or void*, but will convert to bool. llvm-svn: 290750
* Remove mblen(), mbtowc() and wctomb() from the thread-unsafe functions.Ed Schouten2016-12-302-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in r240527 I added a knob to prevent thread-unsafe functions from being exposed. mblen(), mbtowc() and wctomb() were also added to this list, as the latest issue of POSIX doesn't require these functions to be thread-safe. It turns out that the only circumstance in which these functions are not thread-safe is in case they are used in combination with state-dependent character sets (e.g., Shift-JIS). According to Austin Group Bug 708, these character sets "[...] are mostly a relic of the past and which were never supported on most POSIX systems". Though in many cases the use of these functions can be prevented by using the reentrant counterparts, they are the only functions that allow you to query whether the locale's character set is state-dependent. This means that omitting these functions removes actual functionality. Let's be a bit less pedantic and drop the guards around these functions. Links: http://austingroupbugs.net/view.php?id=708 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2037.htm Reviewed by: ericwf Differential Revision: https://reviews.llvm.org/D21436 llvm-svn: 290748
* Get ctype_byname tests passing on Linux.Eric Fiselier2016-12-306-75/+96
| | | | llvm-svn: 290746
* Fix PR31489 - std::function self-swap segfaultsEric Fiselier2016-12-292-94/+195
| | | | llvm-svn: 290721
* Fix debug mode for vector/list and cleanup testsEric Fiselier2016-12-2826-855/+345
| | | | llvm-svn: 290657
* Add tests for unordered container tests and std::stringEric Fiselier2016-12-284-0/+547
| | | | llvm-svn: 290655
* Fix build errors in C++03 caused by recent debug changesEric Fiselier2016-12-281-2/+2
| | | | llvm-svn: 290653
* Implement a throwing version of _LIBCPP_ASSERT.Eric Fiselier2016-12-283-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | This patch implements changes to allow _LIBCPP_ASSERT to throw on failure instead of aborting. The main changes needed to do this are: 1. Change _LIBCPP_ASSERT to call a handler via a replacable function pointer instead of calling abort directly. Additionally this patch implements two handler functions, one which aborts and another that throws an exception. 2. Add _NOEXCEPT_DEBUG macro for disabling noexcept spec on function which contain _LIBCPP_ASSERT. This is required in order to prevent assertion failures throwing through a noexcept function. This macro has no effect unless _LIBCPP_DEBUG_USE_EXCEPTIONS is defined. Having a non-aborting _LIBCPP_ASSERT is very important to allow sane testing of debug mode. Currently we can only have one test case per file, since the test case will cause the program to abort. Testing debug mode this way would require thousands of test files, most of which would be 95% boiler plate. I don't think this is a feasible strategy. Fortunately using a throwing debug handler solves these issues. Additionally this patch rewrites the documentation for debug mode. llvm-svn: 290651
* Implement P0435R1 - Resolving LWG issues for common_typeEric Fiselier2016-12-271-10/+183
| | | | llvm-svn: 290627
* Fix PR31481 - 3+ parameter common_type isn't SFINAE friendlyEric Fiselier2016-12-271-5/+17
| | | | llvm-svn: 290624
* Fix bug #31387 - not checking end iterator when parsing decimal escape. ↵Marshall Clow2016-12-241-0/+44
| | | | | | Thanks to Karen for the report. llvm-svn: 290500
* Enable -Wunreachable-code and fix duplicate warning flagsEric Fiselier2016-12-243-9/+9
| | | | llvm-svn: 290486
* Fix ASAN test failureEric Fiselier2016-12-241-1/+3
| | | | llvm-svn: 290482
* Fix -Wsign-compare warnings in re tests that only run on OS XEric Fiselier2016-12-247-224/+224
| | | | llvm-svn: 290481
* Fix sign-compare warnings on ARM platforms caused by wchar_t being unsignedEric Fiselier2016-12-241-7/+7
| | | | llvm-svn: 290480
* Fix warning caused by platforms providing a signed wint_tEric Fiselier2016-12-241-1/+2
| | | | llvm-svn: 290477
* Fix yet another missed -Wunused warning. Hopefully this is the last oneEric Fiselier2016-12-241-7/+8
| | | | llvm-svn: 290476
* Fix unused warning which only triggers in C++11Eric Fiselier2016-12-241-0/+3
| | | | llvm-svn: 290475
* fix warnings only produced by apple-clangEric Fiselier2016-12-248-44/+27
| | | | llvm-svn: 290474
* Fix missed sign-compare warningEric Fiselier2016-12-241-1/+1
| | | | llvm-svn: 290473
* fix newly failing c++03 testsEric Fiselier2016-12-242-3/+8
| | | | llvm-svn: 290472
* Fix another unused warningEric Fiselier2016-12-241-0/+1
| | | | llvm-svn: 290470
* fix sign comparison warningsEric Fiselier2016-12-241-3/+1
| | | | llvm-svn: 290469
* Fix unused parameters and variablesEric Fiselier2016-12-23103-213/+202
| | | | llvm-svn: 290459
* Update doc and various cleanupEric Fiselier2016-12-231-19/+70
| | | | llvm-svn: 290446
* Add test that _LIBCPP_VERSION matches __libcpp_versionEric Fiselier2016-12-231-0/+28
| | | | llvm-svn: 290445
* Add apple-clang-8 to list of XFAILS for some variant tests. Patch from ↵Eric Fiselier2016-12-234-4/+4
| | | | | | Michael Park llvm-svn: 290440
* Fix XFAILS for is_trivially_destructible traitEric Fiselier2016-12-152-6/+0
| | | | llvm-svn: 289802
* Fix typoEric Fiselier2016-12-151-1/+1
| | | | llvm-svn: 289781
* Add tests for LWG 2796Eric Fiselier2016-12-152-0/+73
| | | | llvm-svn: 289780
* Add more test cases for PR31384Eric Fiselier2016-12-151-9/+59
| | | | llvm-svn: 289778
* Add test case for PR31384Eric Fiselier2016-12-151-0/+38
| | | | llvm-svn: 289774
* Revert r289727 due to PR31384Eric Fiselier2016-12-153-414/+0
| | | | | | | | This patch reverts the changes to tuple which fixed construction from types derived from tuple. It breaks the code mentioned in llvm.org/PR31384. I'll follow this commit up with a test case. llvm-svn: 289773
* XFAIL test for more apple-clang versionsEric Fiselier2016-12-151-1/+1
| | | | llvm-svn: 289767
* Work around bug in initialization of std::array base class with older clangsEric Fiselier2016-12-142-3/+9
| | | | llvm-svn: 289741
* Fix PR31378 - std::list::remove should not require a default constructible ↵Eric Fiselier2016-12-143-33/+89
| | | | | | | | | | | | allocator. In list::remove we collect the nodes we're removing in a seperate list instance. However we construct this list using the default constructor which default constructs the allocator. However allocators are not required to be default constructible. This patch fixes the construction of the second list. llvm-svn: 289735
* [libcxx] [test] Fix MSVC x64 truncation warnings with 32-bit allocator ↵Stephan T. Lavavej2016-12-144-4/+4
| | | | | | | | | | | | | | | | size_type/difference_type. test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp Iterate with C::size_type because that's what operator[] takes. test/std/containers/sequences/vector/contiguous.pass.cpp test/std/strings/basic.string/string.require/contiguous.pass.cpp Add static_cast<typename C::difference_type> because that's what the iterator's operator+ takes. Fixes D27777. llvm-svn: 289734
* [libcxx] Fix tuple construction/assignment from types derived from ↵Eric Fiselier2016-12-143-0/+408
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tuple/pair/array. Summary: The standard requires tuple have the following constructors: ``` tuple(tuple<OtherTypes...> const&); tuple(tuple<OtherTypes...> &&); tuple(pair<T1, T2> const&); tuple(pair<T1, T2> &&); tuple(array<T, N> const&); tuple(array<T, N> &&); ``` However libc++ implements these as a single constructor with the signature: ``` template <class TupleLike, enable_if_t<__is_tuple_like<TupleLike>::value>> tuple(TupleLike&&); ``` This causes the constructor to reject types derived from tuple-like types; Unlike if we had all of the concrete overloads, because they cause the derived->base conversion in the signature. This patch fixes this issue by detecting derived types and the tuple-like base they are derived from. It does this by creating an overloaded function with signatures for each of tuple/pair/array and checking if the possibly derived type can convert to any of them. This patch fixes [PR17550]( https://llvm.org/bugs/show_bug.cgi?id=17550) This patch Reviewers: mclow.lists, K-ballo, mpark, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27606 llvm-svn: 289727
* XFAIL test on apple-clang-7.0Eric Fiselier2016-12-141-1/+1
| | | | llvm-svn: 289716
* [libcxx] Fix PR24075, PR23841 - Add ↵Eric Fiselier2016-12-146-0/+891
| | | | | | | | | | | | | | | | | | | | scoped_allocator_adaptor::construct(pair<T, U>*, ...) overloads. Summary: For more information see: * https://llvm.org/bugs/show_bug.cgi?id=23841 * https://llvm.org/bugs/show_bug.cgi?id=24075 I hope you have as much fun reviewing as I did writing these insane tests! Reviewers: mclow.lists, AlisdairM, EricWF Subscribers: AlisdairM, Potatoswatter, cfe-commits Differential Revision: https://reviews.llvm.org/D27612 llvm-svn: 289710
* Recommit r286884: P0503R0, adopted in Issaquah, rewords some requirements on ↵Eric Fiselier2016-12-143-3/+47
| | | | | | | | | | | | | | | nullptr_t and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests. This patch was reverted due to llvm.org/PR31016. There is a bug in Clang 3.7 which causes default.pass.cpp to fails. That test is now marked as XFAIL for that clang version. This patch was originally authored by Marshall Clow. llvm-svn: 289708
* [libcxx] [test] Fix size_t-to-int truncation warnings in syserr.hash.Stephan T. Lavavej2016-12-132-4/+4
| | | | | | | | | | | | | | | | After r289363, these tests were triggering MSVC x64 warning C4267 "conversion from 'size_t' to 'int', possible loss of data" by taking 0, 2, and 10 as std::size_t, then constructing error_code(int, const error_category&) or error_condition(int, const error_category&) from that (N4618 19.5.3.2 [syserr.errcode.constructors]/3, 19.5.4.2 [syserr.errcondition.constructors]/3). The fix is simple: take these ints as int, pass them to the int-taking constructor, and perform a value-preserving static_cast<std::size_t> when comparing them to `std::size_t result`. Fixes D27691. llvm-svn: 289512
* [libcxx] [test] Change ifstream constructor tests to handle read-only files.Stephan T. Lavavej2016-12-124-24/+36
| | | | | | | | | | | | | Certain source control systems like to set the read-only bit on their files, which interferes with opening "test.dat" for both input and output. Fortunately, we can work around this without losing test coverage. Now, the ifstream.cons tests have comments referring to the ofstream.cons tests. There, we're creating writable files (not checked into source control), where the ifstream constructor tests will succeed. Fixes D26814. llvm-svn: 289463
* [libcxx] [test] Fix an improper assumption about Null Forward Iterators.Stephan T. Lavavej2016-12-121-4/+0
| | | | | | | | Value-initialized iterators still can't be compared to those with parents. Fixes D26626. llvm-svn: 289462
* Actually re-disable -Wsign-compareEric Fiselier2016-12-111-1/+1
| | | | llvm-svn: 289367
* Re-disable -Wsign-compare for now. I didn't catch all occurrencesEric Fiselier2016-12-111-0/+1
| | | | llvm-svn: 289366
OpenPOWER on IntegriCloud