summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and ↵Eric Fiselier2017-04-181-84/+46
| | | | | | std::unordered_multiset llvm-svn: 300619
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.Eric Fiselier2017-04-181-44/+35
| | | | llvm-svn: 300604
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.Eric Fiselier2017-04-181-17/+16
| | | | llvm-svn: 300602
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimapEric Fiselier2017-04-181-58/+37
| | | | llvm-svn: 300600
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multisetEric Fiselier2017-04-181-49/+42
| | | | llvm-svn: 300595
* Work around GCC 4.9 bug regarding default initialization of const variablesEric Fiselier2017-04-171-13/+15
| | | | llvm-svn: 300510
* Fix passing incorrectly value-category when constructing unique_ptr's deleterEric Fiselier2017-04-171-1/+1
| | | | llvm-svn: 300489
* [optional] Update synopsis for LWG2934Casey Carter2017-04-171-38/+40
| | | | | | (comment-only change) llvm-svn: 300488
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>Eric Fiselier2017-04-161-79/+48
| | | | llvm-svn: 300415
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>Eric Fiselier2017-04-161-64/+44
| | | | llvm-svn: 300414
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in dequeEric Fiselier2017-04-161-102/+78
| | | | llvm-svn: 300413
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>Eric Fiselier2017-04-161-2/+2
| | | | llvm-svn: 300412
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.Eric Fiselier2017-04-161-65/+60
| | | | | | | | | | | | | This patch cleans up all usages of the following feature test macros inside <vector> and its tests: * _LIBCPP_HAS_NO_RVALUE_REFERENCES * _LIBCPP_HAS_NO_VARIADICS * _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS Where needed the above guards were replaced with _LIBCPP_CXX03_LANG. llvm-svn: 300410
* Cleanup and better scope unique_ptr internalsEric Fiselier2017-04-161-25/+20
| | | | llvm-svn: 300408
* Cleanup default_delete specializationsEric Fiselier2017-04-161-55/+43
| | | | llvm-svn: 300407
* Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.Eric Fiselier2017-04-161-351/+526
| | | | | | | | | | | | | | | | | | | | | This patch overhauls both specializations of unique_ptr while implementing the following LWG issues: * LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type is not default constructible. Additionally it adds SFINAE conditions to unique_ptr<T[]>::unique_ptr(Up). * LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter) constructors so that they correctly SFINAE when the deleter argument cannot be used to construct the stored deleter. * LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr. Libc++ had previously implemented this issue, but the suggested resolution still broke initialization from NULL. This patch re-works the unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well as nullptr. llvm-svn: 300406
* Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.Eric Fiselier2017-04-151-16/+18
| | | | | | | Also mark LWG 2857 as complete, since the changes to optional and any were completed by Marshall earlier. llvm-svn: 300403
* Fix PR32642 - string::insert and string::append don't work with move_iterator.Eric Fiselier2017-04-151-2/+6
| | | | llvm-svn: 300397
* [libcxx] Direct support for FuchsiaPetr Hosek2017-04-133-2/+27
| | | | | | | | | | | Fuchsia's libc was forked from musl, but has evolved sufficiently since then so it no longer makes sense to pretend it's musl. This change implements direct support for Fuchsia rather than piggybacking on musl support. Differential Revision: https://reviews.llvm.org/D31970 llvm-svn: 300261
* [libc++] Add _LIBCPP_DISABLE_EXTERN_TEMPLATE config optionShoaib Meenai2017-04-131-0/+5
| | | | | | | | | | | | | | | | | | When the libc++ extern template macros were added, the intent was for it to be possible for consumers of the headers to disable extern templates (via `-D_LIBCPP_EXTERN_TEMPLATE(...)=`). Unfortunately, support for specifying function-like macros varies on the command line varies across compilers (e.g. MSVC doesn't support it at all), and cmake doesn't allow it for the same reason. Add a non-function macro for this purpose. The intended use is for libraries which want to use the libc++ headers without taking a dependency on the libc++ library itself. I can name the macro something which reflects its intent rather than its behavior (e.g. `_LIBCPP_HEADER_ONLY`) if desired. Differential Revision: https://reviews.llvm.org/D31725 llvm-svn: 300246
* Remove the binders from C++17. Reviewed as https://reviews.llvm.org/D31769Marshall Clow2017-04-132-24/+27
| | | | llvm-svn: 300232
* Implement LWG#2855 - made easy by previous refactoringMarshall Clow2017-04-131-2/+2
| | | | llvm-svn: 300218
* Refactor throw_with_nested. NFC.Marshall Clow2017-04-131-31/+39
| | | | llvm-svn: 300197
* Diagnose when reverse_iterator is used on path::iterator.Eric Fiselier2017-04-132-10/+15
| | | | | | | | | | | | | | | path::iterator isn't a strictly conforming iterator. Specifically it stashes the current element inside the iterator. This leads to UB when used with reverse_iterator since it requires the element to outlive the lifetime of the iterator. This patch adds a static_assert inside reverse_iterator to disallow "stashing iterator types", and it tags path::iterator as such a type. Additionally this patch removes all uses of reverse_iterator<path::iterator> within the tests. llvm-svn: 300164
* Fix C++03 test failuresEric Fiselier2017-04-131-1/+1
| | | | llvm-svn: 300159
* Fix more bad member swap definitions in unordered_map.Eric Fiselier2017-04-131-2/+2
| | | | | | | | | | | The __unordered_map_equal and __unordered_map_hash wrappers attempt to swap const qualified predicates whenever the predicate is empty, and is subject to the EBO. Swapping const values seems blatently incorrect. This patch removes the const qualifier so the values are swapped as non-const. llvm-svn: 300154
* Fix the default constructibility of __compressed_pair.Eric Fiselier2017-04-131-2/+8
| | | | | | | This patch fixes a bug where the =default default ctor for __compressed_pair was incorrect for const qualified types. llvm-svn: 300152
* Fix most failures caused by r300140Eric Fiselier2017-04-133-7/+7
| | | | | | | | | | | | | | | | | | | | | r300140 introduced a bunch of failures by changing the internal interface provided by __compressed_pair. This patch fixes all of the failures caused by the new interface by changing the existing code to use it. In addition to those changes this patch also fixes two separate issues causing test failures: 1) Fix the member swap definition for __map_value_compare. Previously the swap was incorrectly configured to swap the comparator as const. 2) Fix an assertion failure in futures.task.members/ctor_func_alloc.pass.cpp that incorrectly expected a move to take place when a single copy is sufficient. There is one remaining failure regarding make_shared. I'll commit a fix for that shortly. llvm-svn: 300148
* [libcxx] Fix __compressed_pair so it doesn't copy the argument multiple ↵Eric Fiselier2017-04-123-300/+167
| | | | | | | | | | | | | | | | | | | | | times, and add constexpr. Summary: __compressed_pair takes and passes it's constructor arguments by value. This causes arguments to be moved 3 times instead of once. This patch addresses that issue and fixes `constexpr` on the constructors. I would rather have this fix than D27564, and I'm fairly confident it's not ABI breaking but I'm not 100% sure. I prefer this solution because it removes a lot of code and makes the implementation *much* smaller. Reviewers: mclow.lists, K-ballo Reviewed By: K-ballo Subscribers: K-ballo, cfe-commits Differential Revision: https://reviews.llvm.org/D27565 llvm-svn: 300140
* [libc++] Implement LWG 2911 - add an is_aggregate type-traitEric Fiselier2017-04-122-1/+25
| | | | | | | | | | | | | | | | | Summary: This patch implements http://cplusplus.github.io/LWG/lwg-defects.html#2911. I'm putting this up for review until __is_aggregate is added to clang (See D31513) Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31515 llvm-svn: 300126
* Implement part of LWG#2857 - any/optional. Still to do - variant. Reviewed ↵Marshall Clow2017-04-122-17/+23
| | | | | | as https://reviews.llvm.org/D31956 llvm-svn: 300123
* Fix incorrectly qualified return type from unique_ptr::get_deleter().Eric Fiselier2017-04-121-8/+12
| | | | | | | | | | | For reference deleter types the const qualifier on the return type of get_deleter() should be ignored, and a non-const deleter should be returned. This patch fixes a bug where "const deleter_type&" is incorrectly formed. llvm-svn: 300121
* [libc++] Use more appropriate conditional for ABI macro definitionShoaib Meenai2017-04-121-10/+15
| | | | | | | | | | | | The inline function definition ABI macro is gated on COFF dllexport semantics, so it's more appropriate to mark it with the object file format macro rather than the generic _WIN32 macro. We now have no uses of _WIN32 apart from those used to define the other Windows macros :) Clarify the ABI macro comment and make the object file format check exhaustive while I'm here. llvm-svn: 300097
* Implement LWG#2873: 'Add noexcept to several shared_ptr related functions' ↵Marshall Clow2017-04-111-24/+39
| | | | | | This issue missed a couple, so I added those as well (see LWG#2942) llvm-svn: 299963
* [libc++] Fix unknown pragma warning on MSVCBen Craig2017-04-111-1/+1
| | | | llvm-svn: 299942
* Fix PR#32605: common_type<T> is not SFINAE-friendlyMarshall Clow2017-04-101-3/+1
| | | | llvm-svn: 299901
* Fix PR#32606: std::decay mishandles abominable function typesMarshall Clow2017-04-101-5/+16
| | | | llvm-svn: 299894
* [libc++] Drop support for CRTs older than VS 2015Shoaib Meenai2017-04-075-67/+25
| | | | | | | | | | | LLVM dropped support for Visual Studio versions older than 2015 quite some time ago, so I consider it safe to drop libc++'s support for older CRTs. The CRT in Visual Studio 2015 provides a lot of previously missing functions, so targeting it requires less special casing. Differential Revision: https://reviews.llvm.org/D31798 llvm-svn: 299743
* [libc++] Respect Windows Store app CRT restrictionsShoaib Meenai2017-04-062-0/+12
| | | | | | | | | | | | | Some CRT APIs are unavailable for Windows Store apps [1]. Detect when we're targeting the Windows Store and don't try to refer to non-existent CRT functions in that case. (This would otherwise lead to a compile error when using the libc++ headers and compiling for Windows Store.) [1] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps Differential Revision: https://reviews.llvm.org/D31737 llvm-svn: 299625
* Use alternate string layout for ARMv7kMehdi Amini2017-04-061-1/+1
| | | | llvm-svn: 299606
* Work around recent -Wshadow changes in ClangEric Fiselier2017-04-042-1/+11
| | | | llvm-svn: 299407
* Fix C++17 dylib buildEric Fiselier2017-04-031-1/+2
| | | | llvm-svn: 299401
* [libc++] Explicitly mark specializations as dllexportShoaib Meenai2017-04-031-4/+4
| | | | | | | | | Method specializations don't get exported even if there's an exported extern template instantiation on Windows. Explicitly mark the methods for export. They're already exported on Linux and Darwin, so there's no ABI change on those platforms. llvm-svn: 299348
* string: Remove always_inline from basic_string::__initDuncan P. N. Exon Smith2017-04-011-5/+5
| | | | | | | | | | | | | | | This is effectively a partial revert of r278356, which started inlining basic_string::__init. Even if we want to help the compiler along with an inlinehint, we shouldn't hamstring it by forcing it to inline all the time. Libc++ uses always_inline widely as a limit-the-ABI-hack, but since __init is already on the dylib boundary, it makes no sense here and just harms the debugging experience at -O0. rdar://problem/31013102 llvm-svn: 299290
* Use strong enums independently of -fobjc-arcDuncan P. N. Exon Smith2017-03-311-1/+0
| | | | | | | | | | | | | | | | | r145698 introduced _LIBCPP_HAS_NO_STRONG_ENUMS by copy-pasting the __has_feature check from objc_arc_weak/_LIBCPP_HAS_OBJC_ARC_WEAK, and accidentally started defining _LIBCPP_HAS_NO_STRONG_ENUMS whenever __has_feature(objc_arc_weak). This is totally bogus, and means that Libc++ thinks Objective-C++ compilations with -fobjc-arc don't have strong enums. Delete the accidental line. I thought about adding a test, but it would be entirely duplicative of the patch (if has-feature strong enums, check that has-no-strong-enums is not defined). llvm-svn: 299236
* Fix LWG 2934 - optional<const T> doesn't compare with TEric Fiselier2017-03-301-54/+54
| | | | llvm-svn: 299105
* Implement LWG 2842 - optional(U&&) needs to SFINAE on decay_t<in_place_t>Eric Fiselier2017-03-301-1/+1
| | | | llvm-svn: 299100
* [libc++] Add a key function for bad_function_callShoaib Meenai2017-03-282-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: bad_function_call is currently an empty class, so any object files using that class will end up with their own copy of its typeinfo, typeinfo name and vtable, leading to unnecessary duplication that has to be resolved by the dynamic linker. Instead, give bad_function_call a key function and put a definition for that key function in libc++ itself, to centralize the typeinfo and vtable. This is consistent with the behavior for other exception classes. The key functions are defined in libc++ rather than libc++abi since the class is defined in the libc++ versioning namespace, so ABI compatibility with libstdc++ is not a concern. Guard this change behind an ABI macro, since it isn't backwards compatible (i.e., clients built against the new libc++ headers wouldn't be able to run against an older libc++ library). Reviewers: mclow.lists, EricWF Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D27387 llvm-svn: 298937
* Implement P0298R3: 'std::byte'. Reviewed as https://reviews.llvm.org/D31022Marshall Clow2017-03-242-0/+60
| | | | llvm-svn: 298689
* Move the scoped_lock inside the '#ifndef NO_THREADS' block to fix the ↵Marshall Clow2017-03-241-79/+78
| | | | | | no-threading build llvm-svn: 298686
OpenPOWER on IntegriCloud