summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* [libcxx] Fix basic_stringbuf constructorZhihao Yuan2017-12-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] P0604, invoke_result and is_invocableZhihao Yuan2017-12-122-28/+58
| | | | | | | | | | | | | | | | | | | | 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
* workaround PR 28385 in __find_exactly_one_checkedCasey Carter2017-12-121-3/+3
| | | | | | | | Fixes #35578. Differential Revision: D41048 llvm-svn: 320500
* [libcxx] Define istream_iterator equality comparison operators out-of-lineRoger Ferrer Ibanez2017-12-111-4/+26
| | | | | | | | | | | | | | | | | 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
* [libc++] Unbreak Apple buildbotsShoaib Meenai2017-12-081-0/+1
| | | | | | | | These buildbots are using the deprecated target name install-libcxx-headers instead of the more up to date install-cxx-headers, so I need to add an install-libcxx-headers-stripped target to satisfy them. llvm-svn: 320201
* [libc++] Create install-stripped targetsShoaib Meenai2017-12-061-0/+2
| | | | | | | | | | | | LLVM is gaining install-*-stripped targets to perform stripped installs, and in order for this to be useful for install-distribution, all potential distribution components should have stripped installation targets. LLVM has a function to create these install targets, but since we can't use LLVM CMake functions in libc++, let's do it manually. Differential Revision: https://reviews.llvm.org/D40680 llvm-svn: 319959
* Enable auto-linking on WindowsSaleem Abdulrasool2017-12-051-0/+7
| | | | | | | | | | | The MSVC driver and clang do not link against the C++ runtime explicitly. Instead, they rely on the auto-linking via the pragma (through `use_ansi.h`) to link against the correct version of the C++ runtime. Attempt to do something similar here so that linking real C++ code on Windows does not require the user to explicitly specify `c++.lib` when using libc++ as a C++ runtime on windows. llvm-svn: 319816
* [libcxx] Fix intrinsics for MSVCShoaib Meenai2017-12-051-8/+8
| | | | | | | | | | The parameter was previously renamed but MSVC path was not updated. Patch by Andrey Khalyavin. Differential Revision: https://reviews.llvm.org/D40774 llvm-svn: 319802
* Mark a couple of internal routines as 'noexcept'Marshall Clow2017-12-051-2/+2
| | | | llvm-svn: 319779
* Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)Marshall Clow2017-12-051-0/+10
| | | | llvm-svn: 319736
* Implement more of P0600: '[[nodiscard]] in the library' for C++2aMarshall Clow2017-12-041-20/+20
| | | | llvm-svn: 319710
* Implement P0457R2: 'String Prefix and Suffix Checking' for c++2aMarshall Clow2017-12-042-0/+66
| | | | llvm-svn: 319687
* Fix PR#35948: generate_n does not accept floating point Size arguments.Marshall Clow2017-12-041-0/+5
| | | | llvm-svn: 319675
* [libcxx] Support getentropy as a source of randomness for std::random_devicePetr Hosek2017-12-011-0/+2
| | | | | | | | | | Use this source use on Fuchsia where this is the oficially way to obtain randomness. This could be also used on other platforms that already support getentropy such as *BSD or Linux. Differential Revision: https://reviews.llvm.org/D40319 llvm-svn: 319523
* Fix problems with r'890 when building on machines where sizeof(size_t) != ↵Marshall Clow2017-11-271-3/+13
| | | | | | sizeof(unsigned long long) and C++03 llvm-svn: 319106
* Revert commit removing allocator support from packaged_task. Will ↵Marshall Clow2017-11-271-0/+34
| | | | | | investigate further llvm-svn: 319091
* Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.Marshall Clow2017-11-271-34/+0
| | | | llvm-svn: 319080
* Fix PR#35438 - bitset constructor does not zero unused bitsMarshall Clow2017-11-271-1/+4
| | | | llvm-svn: 319074
* Fix failure on C++03 botsMarshall Clow2017-11-271-0/+2
| | | | llvm-svn: 319042
* Implement LWG#2948: unique_ptr does not define operator<< for stream outputMarshall Clow2017-11-272-0/+15
| | | | llvm-svn: 319038
* More of P0600; marking allocation routines as [[nodiscard]]Marshall Clow2017-11-262-9/+10
| | | | llvm-svn: 318992
* Allow to set locale on Windows.Martin Storsjo2017-11-233-4/+95
| | | | | | | | | | | | | | | Fix the problem PR31516 with setting locale on Windows by wrapping _locale_t with a pointer-like class. Reduces 74 test failures in std/localization test suite to 47 test failures (on llvm clang, Visual Studio 2015). Number of test failures doesn't depend on the platform (x86 or x64). Patch by Andrey Khalyavin. Differential Revision: https://reviews.llvm.org/D40181 llvm-svn: 318902
* Add [[nodiscard]] to std::async as part of P0600.Marshall Clow2017-11-232-2/+3
| | | | llvm-svn: 318889
* [libcxx] Implement std::to_address for C++20Eric Fiselier2017-11-221-1/+40
| | | | | | | | | | | | | | 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-222-0/+33
| | | | llvm-svn: 318864
* [libcxx] Make std::basic_istream::getline 0-terminate input array in case of ↵Volodymyr Sapsai2017-11-221-2/+4
| | | | | | | | | | | | | 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
* Remove a broken win32 locale function redirectionMartin Storsjo2017-11-211-1/+0
| | | | | | | | | | | | | | | | One can't replace vsscanf(_l) with a sscanf(_l) that doesn't take a va_list. This has been untouched since it was added in SVN r140728, so apparently it hasn't been used since. One reason for this mistake originally might have been that there was no _vsscanf_l until MSVC 2015. Since it's unused, just remove this define. Differential Revision: https://reviews.llvm.org/D40323 llvm-svn: 318810
* Fix std::string::data() symbol during library build.Eric Fiselier2017-11-201-1/+1
| | | | | | | | | | | | | | The non-const data() member of std::string is only exposed in C++17 and beyond. However std::string is externally instantiated and so the member function needs to be exposed to be externally instantiated. On Linux and OS X this shouldn't cause a problem, because _LIBCPP_INLINE_VISIBILITY ensures the symbol is always inlined. However on Windows, the symbol gets marked dllimport, but there is no definition to import, causing link errors. llvm-svn: 318690
* Fix min/max usage in variantEric Fiselier2017-11-191-0/+5
| | | | llvm-svn: 318622
* [libc++] Shrink variant's index type when possibleEric Fiselier2017-11-192-8/+35
| | | | | | | | | | | | | | | | | | | Summary: Currently `std::variant` always uses an unsigned int to store the variant index. However this isn't nessesary and causes `std::variant` to be larger than it needs to be in most cases. This patch changes the index type to be `unsigned char` when possible, and `unsigned short` or `unsigned int` otherwise, depending on the size (Although it's questionable if it's even possible to create a variant with 65535 elements. Unfortunately this change is an ABI break, and as such is only enabled in ABI v2. Reviewers: mpark Reviewed By: mpark Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40210 llvm-svn: 318621
* Mark free functions size/empty/data conditionally noexcept.Marshall Clow2017-11-161-4/+31
| | | | llvm-svn: 318432
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-161-1/+2
| | | | | | filesystem::path llvm-svn: 318378
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-161-4/+4
| | | | | | match_results. <regex> llvm-svn: 318375
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-153-419/+429
| | | | | | 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
* First part of P0600 - '[[nodiscard] in the standard library'. Mark the ↵Marshall Clow2017-11-1511-17/+17
| | | | | | '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
* Add two new macros: _LIBCPP_NODISCARD_AFTER_CXX17 and ↵Marshall Clow2017-11-141-0/+15
| | | | | | _LIBCPP_CONSTEXPR_AFTER_CXX17, along with a way to turn off the NODISCARD one: _LIBCPP_DISABLE_NODISCARD_AFTER_CXX17. No one is using these yet, but we will be ... soon llvm-svn: 318208
* Rename identifiers named `__output`Alexander Richardson2017-11-144-51/+51
| | | | | | | | | | | | | | | | Summary: In the CHERI clang compiler __output and __input are keywords and therefore we can't compile libc++ with our compiler. Reviewers: mclow.lists, EricWF, theraven Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39537 llvm-svn: 318144
* Implement LWG2950: std::byte operations are misspecifiedMarshall Clow2017-11-142-15/+38
| | | | llvm-svn: 318125
* Implement LWG2952: iterator_traits should work for pointers to cv TMarshall Clow2017-11-141-11/+1
| | | | llvm-svn: 318119
* Implement P0550R2: Transformation Trait remove_cvrefMarshall Clow2017-11-131-0/+14
| | | | llvm-svn: 318011
* Add _LIBCPP_INLINE_VISIBILITY to __compressed_pair_elem membersAlex Lorenz2017-11-091-6/+12
| | | | | | | | | | | | | | The commit r300140 changed the implementation of compressed_pair, but didn't add _LIBCPP_INLINE_VISIBILITY to the constructors and get members of the compressed_pair_elem class. This patch adds the visibility annotation. I didn't find a way to test this change with libc++ regression tests. rdar://35352579 Differential Revision: https://reviews.llvm.org/D39751 llvm-svn: 317816
* Revert "[libc++] Don't alias quick_exit if __ANDROID_API__ < 21"Dan Albert2017-11-011-5/+1
| | | | | | | | Broke the Darwin build bots. This reverts commit f56f1bba1ade4a408d403ff050d50e837bae47df. llvm-svn: 317142
* [libc++] Don't alias quick_exit if __ANDROID_API__ < 21Dan Albert2017-11-011-1/+5
| | | | | | | | | | | | | | | | | | | | Summary: quick_exit() and at_quick_exit() were introduced in android NDK 21: https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/stdlib.h#55 This CL conditions `_LIBCPP_HAS_QUICK_EXIT` on `__ANDROID_API__ >= 21`. The only place this macro is used is in some using declarations: `using ::quick_exit`, `using ::at_quick_exit`. Also, add a missing include to sys/cdefs.h which is what defines `__BIONIC__`. Reviewers: thakis, danalbert, EricWF Reviewed By: danalbert Subscribers: srhines, krytarowski Differential Revision: https://reviews.llvm.org/D39479 llvm-svn: 317124
* Update the synopsis to match the P/R of 2945. No code changes.Marshall Clow2017-11-011-6/+6
| | | | llvm-svn: 317063
* Implement LWG 3013 - some filesystem members should not be noexcept.Eric Fiselier2017-10-301-11/+11
| | | | | | | | | | | | | | | 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 PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis ↵Marshall Clow2017-10-301-1/+1
| | | | | | 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-241-1/+1
| | | | | | 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-8/+8
| | | | | | for the bug report. llvm-svn: 316439
* Fix misguided error message in debug mode. No functional change. Fixes PR#34966Marshall Clow2017-10-231-1/+1
| | | | llvm-svn: 316343
* Fix an unsigned integer overflow in regex that lead to a bad memory access. ↵Marshall Clow2017-10-191-5/+11
| | | | | | Found by OSS-Fuzz llvm-svn: 316191
OpenPOWER on IntegriCloud