summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the definitions of 'reference' and 'pointer' in string_view that no one ↵Marshall Clow2017-12-201-0/+77
| | | | | | uses :-). Thanks to K-ballo for the catch. llvm-svn: 321188
* libcxx: Fix for basic_stringbuf::seekoff() after r320604.Peter Collingbourne2017-12-191-0/+24
| | | | | | | | | | | | | As a result of this change, the basic_stringbuf constructor that takes a mode ends up leaving __hm_ set to 0, causing the comparison "__hm_ - __str_.data() < __noff" in seekoff() to succeed, which caused the function to incorrectly return -1. The fix is to account for the possibility of __hm_ being 0 when computing the distance from __hm_ to the start of the string. Differential Revision: https://reviews.llvm.org/D41319 llvm-svn: 321124
* [libcxx] Fix basic_stringbuf constructorZhihao Yuan2017-12-131-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [libcxx] Fix basic_stringbuf constructor The C++ Standard [stringbuf.cons]p1 defines the effects of the basic_stringbuf constructor that takes ios_base::openmode as follows: Effects: Constructs an object of class basic_stringbuf, initializing the base class with basic_streambuf(), and initializing mode with which. Postconditions: str() == "". The default constructor of basic_streambuf shall initialize all its pointer member objects to null pointers [streambuf.cons]p1. Currently libc++ calls "str(string_type());" in the aforementioned constructor setting basic_streambuf's pointers to a non-null value. This patch removes the call (note that the postcondition str() == "" remains valid because __str_ is default-initialized) and adds a test checking that the basic_streambuf's pointers are null after construction. Thanks Mikhail Maltsev for the patch. Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40707 llvm-svn: 320604
* [libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.Stephan T. Lavavej2017-12-132-15/+15
| | | | | | | | | | | | | | | benchmarks/util_smartptr.bench.cpp Change CRLF to LF. test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp Consistently comment "\u20ac" as EURO SIGN, its Unicode name, instead of the actual Unicode character. test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp Avoid non-ASCII dash. Fixes D40991. llvm-svn: 320536
* [libcxx] [test] Fix MSVC warnings, null pointer deref.Stephan T. Lavavej2017-12-134-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp Silence MSVC warning C4244. This is expected when passing floating-point values for size. test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp Avoid MSVC "warning C4293: '<<': shift count negative or too big, undefined behavior". MSVC sees (1ULL << N) and warns - being guarded by const bool canFit is insufficient. A small change to the code avoids the warning without the need for a pragma. Remove a spurious printf() declaration from to_ullong.pass.cpp. Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was probably copy-pasted. test/std/utilities/tuple/tuple.general/ignore.pass.cpp Use LIBCPP_STATIC_ASSERT for consistency with other files. test/support/container_test_types.h Fix a null pointer dereference, found by MSVC /analyze warning C6011 "Dereferencing NULL pointer 'm_expected_args'." Fixes D41030. llvm-svn: 320535
* [libcxx] P0604, invoke_result and is_invocableZhihao Yuan2017-12-128-291/+349
| | | | | | | | | | | | | | | | | | | | Summary: Introduce a new form of `result_of` without function type encoding. Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly) Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists. Reviewers: EricWF, mclow.lists, bebuch Reviewed By: EricWF, bebuch Subscribers: lichray, bebuch, cfe-commits Differential Revision: https://reviews.llvm.org/D38831 llvm-svn: 320509
* [libcxx] Define istream_iterator equality comparison operators out-of-lineRoger Ferrer Ibanez2017-12-111-0/+3
| | | | | | | | | | | | | | | | | Currently libc++ defines operator== and operator!= as friend functions in the definition of the istream_iterator class template. Such definition has a subtle difference from an out-of-line definition required by the C++ Standard: these functions can only be found by argument-dependent lookup, but not by qualified lookup. This patch changes the definition, so that it conforms to the C++ Standard and adds a check involving qualified lookup to the test suite. Patch contributed by Mikhail Maltsev. Differential Revision: https://reviews.llvm.org/D40415 llvm-svn: 320363
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-12-075-5/+5
| | | | llvm-svn: 319994
* Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)Marshall Clow2017-12-052-0/+58
| | | | llvm-svn: 319736
* Commit tests for changes in revision 319710Marshall Clow2017-12-0410-0/+252
| | | | llvm-svn: 319711
* Ooops. I checked in a test for a bug I haven't fixed yet. Temporrarily ↵Marshall Clow2017-12-041-0/+2
| | | | | | commented it out. llvm-svn: 319693
* Implement P0457R2: 'String Prefix and Suffix Checking' for c++2aMarshall Clow2017-12-0413-0/+861
| | | | llvm-svn: 319687
* Fix PR#35948: generate_n does not accept floating point Size arguments.Marshall Clow2017-12-041-5/+18
| | | | llvm-svn: 319675
* Fix problems with r'890 when building on machines where sizeof(size_t) != ↵Marshall Clow2017-11-272-6/+3
| | | | | | sizeof(unsigned long long) and C++03 llvm-svn: 319106
* Revert commit removing allocator support from packaged_task. Will ↵Marshall Clow2017-11-272-0/+37
| | | | | | investigate further llvm-svn: 319091
* Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.Marshall Clow2017-11-272-37/+0
| | | | llvm-svn: 319080
* Fix PR#35438 - bitset constructor does not zero unused bitsMarshall Clow2017-11-272-1/+20
| | | | llvm-svn: 319074
* Fix failure on C++03 botsMarshall Clow2017-11-272-0/+6
| | | | llvm-svn: 319042
* Implement LWG#2948: unique_ptr does not define operator<< for stream outputMarshall Clow2017-11-272-0/+60
| | | | llvm-svn: 319038
* More of P0600; marking allocation routines as [[nodiscard]]Marshall Clow2017-11-264-0/+137
| | | | llvm-svn: 318992
* Fix copy/paste bug in test where we were putting a '3' into a vector<bool>. NFC.Marshall Clow2017-11-261-2/+2
| | | | llvm-svn: 318990
* Add additional 'UNSUPPORTED' to the test case.Marshall Clow2017-11-231-1/+2
| | | | llvm-svn: 318897
* Add [[nodiscard]] to std::async as part of P0600.Marshall Clow2017-11-231-0/+37
| | | | llvm-svn: 318889
* [libcxx] Implement std::to_address for C++20Eric Fiselier2017-11-221-0/+120
| | | | | | | | | | | | | | Summary: Now implements P0653R2 - Utility to convert to raw pointer. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35470 llvm-svn: 318865
* Implement p0137r1 - std::launder. Reviewed as https://reviews.llvm.org/D40144Marshall Clow2017-11-223-0/+96
| | | | llvm-svn: 318864
* [libcxx][fixup] Mark std::basic_istream::getline tests as failing for ↵Volodymyr Sapsai2017-11-222-0/+16
| | | | | | | | | previous libcxx versions. r318862 added a fix for 0-termination input array in case of an error. Previous libcxx versions don't have the fix and corresponding tests should be failing. llvm-svn: 318863
* [libcxx] Make std::basic_istream::getline 0-terminate input array in case of ↵Volodymyr Sapsai2017-11-222-0/+108
| | | | | | | | | | | | | error. It covers the cases when the sentry object returns false and when an exception was thrown. Corresponding standard paragraph is C++14 [istream.unformatted]p21: In any case, if n is greater than zero, it then stores a null character (using charT()) into the next successive location of the array. Patch by Reimar Döffinger. llvm-svn: 318862
* Add another test_macros.h include I missed to tuple.by.type.pass.cppBilly Robert O'Neal III2017-11-221-0/+1
| | | | llvm-svn: 318830
* Add some tests for operations on const associative containers. Part of LWG#2542Marshall Clow2017-11-226-9/+32
| | | | llvm-svn: 318818
* Replace assert(true) in tests with actual asserts. Reviewed as ↵Billy Robert O'Neal III2017-11-211-2/+2
| | | | | | | | | | | | | | https://reviews.llvm.org/D40324 In a17cd7c641c34b6c4bd4845a4d4fb590cb6c238c Marshall added assert(true) to the vector<bool>::size tests, which break on C1XX: D:\Contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(62): error C2220: warning treated as error - no 'object' file generated d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(33) : warning C6326: Potential comparison of a constant with another constant. d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(52) : warning C6326: Potential comparison of a constant with another constant. The corresponding test for vector::size asserts assert(c.size() == 3);, so I changed it to do that here. llvm-svn: 318812
* Add missing test_macros.h inclusion.Billy Robert O'Neal III2017-11-211-0/+1
| | | | llvm-svn: 318808
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-2164-96/+101
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-162-1/+30
| | | | | | filesystem::path llvm-svn: 318378
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-161-0/+27
| | | | | | match_results. <regex> llvm-svn: 318375
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-157-1/+147
| | | | | | string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big. llvm-svn: 318328
* [test] Alignment must be > __STDCPP_DEFAULT_NEW_ALIGNMENT__ to call aligned newCasey Carter2017-11-1510-10/+10
| | | | | | Differential Revision: D39221 llvm-svn: 318325
* Clean up the tests for free data(), size() and empty()Marshall Clow2017-11-153-24/+28
| | | | llvm-svn: 318313
* Tolerate even more [[nodiscard]] in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-1535-100/+104
| | | | | | https://reviews.llvm.org/D39080 llvm-svn: 318277
* Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-1558-74/+98
| | | | | | https://reviews.llvm.org/D39033 llvm-svn: 318276
* First part of P0600 - '[[nodiscard] in the standard library'. Mark the ↵Marshall Clow2017-11-1517-0/+476
| | | | | | 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only llvm-svn: 318269
* Still more missing tests - this time for the unordered containersMarshall Clow2017-11-158-0/+432
| | | | llvm-svn: 318268
* More missing tests - array<>::size() and array<>::max_size()Marshall Clow2017-11-152-0/+72
| | | | llvm-svn: 318256
* Added tests for xxx.size() and xxx.empty() for all the sequence containersMarshall Clow2017-11-159-0/+478
| | | | llvm-svn: 318244
* Another test for LWG2952Marshall Clow2017-11-141-0/+28
| | | | llvm-svn: 318126
* Implement LWG2952: iterator_traits should work for pointers to cv TMarshall Clow2017-11-141-0/+28
| | | | llvm-svn: 318119
* Implement P0550R2: Transformation Trait remove_cvrefMarshall Clow2017-11-131-0/+52
| | | | llvm-svn: 318011
* Change test suite to support c++17 dialect flag instead of c++1z.Eric Fiselier2017-11-073-3/+3
| | | | | | | | This patch changes the test suite to attempt and prefer -std=c++17 over -std=c++1z. It also fixes the REQUIRES and UNSUPPORTED lit markers to refer to c++17 over c++1z. llvm-svn: 317610
* Change a bunch of comments from C++1z to C++17. NFCMarshall Clow2017-11-0216-16/+16
| | | | llvm-svn: 317212
* Mark tests as unsupported in C++98 as wellRoger Ferrer Ibanez2017-11-022-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D38362 llvm-svn: 317210
* Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFCMarshall Clow2017-10-311-0/+23
| | | | llvm-svn: 316969
OpenPOWER on IntegriCloud