summaryrefslogtreecommitdiffstats
path: root/libcxx/include/experimental
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove more of the std::experimental bits that are now in std::. All the _v ↵Marshall Clow2018-02-065-616/+4
| | | | | | type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324423
* Remove <experimental/string_view>; use <string_view> instead. See ↵Marshall Clow2018-02-051-808/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324290
* Implement LWG 3014 - Fix more noexcept issues in filesystem.Eric Fiselier2018-02-041-8/+8
| | | | | | | | | This patch removes the noexcept declaration from filesystem operations which require creating temporary paths or creating a directory iterator. Either of these operations can throw. llvm-svn: 324192
* Implement LWG2989: path's streaming operators allow everything under the sun.Eric Fiselier2018-02-041-35/+37
| | | | | | | | | | | | | | | Because path can be constructed from a ton of different types, including string and wide strings, this caused it's streaming operators to suck up all sorts of silly types via silly conversions. For example: using namespace std::experimental::filesystem::v1; std::wstring w(L"wide"); std::cout << w; // converts to path. This patch tentatively adopts the resolution to LWG2989 and fixes the issue by making the streaming operators friends of path. llvm-svn: 324189
* Remove std::experimental::sample; use std::sample instead. See ↵Marshall Clow2018-02-011-15/+2
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323979
* Remove <experimental/numeric>; use <numeric> instead. See ↵Marshall Clow2018-02-011-109/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323975
* Remove <experimental/any>; use <any> instead. See ↵Marshall Clow2018-02-011-582/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323972
* Remove <experimental/optional>; use <optional> instead. See ↵Marshall Clow2018-02-011-912/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323971
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-161-1/+2
| | | | | | filesystem::path llvm-svn: 318378
* Rename identifiers named `__output`Alexander Richardson2017-11-142-7/+7
| | | | | | | | | | | | | | | | 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 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
* any: Add availability for experimental::bad_any_castDuncan P. N. Exon Smith2017-06-181-4/+5
| | | | | | | | As a follow up to r302172, add missing availability for bad_any_cast. rdar://problem/32161524 llvm-svn: 305647
* Allow coroutine_handle<const T> to support creation from const references to ↵Eric Fiselier2017-06-161-2/+4
| | | | | | | | | | | | | | | the promise_type It seems conceivable that a user would need to get a coroutine handle having only a const reference to the promise_type, for example from within a const member function of the promise. This patch allows that use case. A coroutine_handle<const T> can be used in essentially the same way a coroutine_handle<T>, ie to start and destroy the coroutine. The constness of the promise doesn't/shouldn't propagate to the handle. llvm-svn: 305536
* [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on WindowsEric Fiselier2017-05-317-17/+50
| | | | | | | | | | | | | | | | Summary: This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning. This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header. Reviewers: mclow.lists, bcraig, compnerd, EricWF Reviewed By: EricWF Subscribers: cfe-commits, krytarowski Differential Revision: https://reviews.llvm.org/D33080 llvm-svn: 304357
* Fix <experimental/coroutine> in C++03Eric Fiselier2017-05-291-2/+2
| | | | llvm-svn: 304173
* [coroutines] Make coroutine_handle<T>::from_address ill-formed for ↵Eric Fiselier2017-05-291-2/+26
| | | | | | | | | | | | | everything but void*. from_address requires that the provided pointer refer to the suspended coroutine, which doesn't have a type, or at least not one knowable by the user. Therefore every use of `from_address` with a typed pointer is almost certainly a bug. This behavior is a part of the TS specification, but hopefully it will be in the future. llvm-svn: 304172
* Fix coroutine test failures caused by API misusages.Eric Fiselier2017-05-291-0/+9
| | | | | | | | More tests to come. I think that from_address overload should be deleted or ill-formed, except for the 'void*' one; The user cannot possibly have a typed pointer to the coroutine state. llvm-svn: 304131
* Fix multiple bugs in coroutine tests.Eric Fiselier2017-05-291-0/+3
| | | | llvm-svn: 304124
* Get <experimental/coroutine> working in C++03.Eric Fiselier2017-05-261-33/+37
| | | | | | | | | | | | | Clang supports coroutines in all dialects; Therefore libc++ should too, otherwise the Clang extension is unusable. I'm not convinced extending support to C++03 is a feasible long term plan, since as the library grows to offer things like generators it will be come increasingly difficult to limit the implementation to C++03. However for the time being supporting C++03 isn't a big deal. llvm-svn: 303963
* Guard <experimental/coroutine> against older Clang versions.Eric Fiselier2017-05-261-5/+5
| | | | | | | | | | | | | | Clang started providing -fcoroutines and defining __cpp_coroutines way before it implemented the __builtin_coro_foo functions. This means that simply checking if __cpp_coroutines is not a sufficient way of detecting the actual feature. This patch implements _LIBCPP_HAS_NO_COROUTINES which implements a slightly more complex feature check. Specifically it requires __cpp_coroutines >= 201703L, which only holds for Clang 5.0 built after 2017/05/24. llvm-svn: 303956
* Re-add <experimental/coroutine> to the module map.Eric Fiselier2017-05-251-3/+3
| | | | | | | | | | | | | The original issues were caused because <experimental/coroutine> didn't correctly #ifdef out enough of the header, which caused incomplete types to be used. This patch fixes the `#if defined(__cpp_coroutines)` guard and re-adds the headers to the module map. It also uglifies some incorrectly non-reserved names. llvm-svn: 303936
* Update more coroutine_handle signatures to reflect N4663.Eric Fiselier2017-05-251-3/+3
| | | | | | | Thanks to Casey Carter for pointing out the out-of-date tests and implementation. llvm-svn: 303900
* Update coroutine_handle<P>::promise to reflect N4663.Eric Fiselier2017-05-251-8/+2
| | | | | | | | | | | This patch updates the promise() member to match the current spec. Specifically it removes the non-const overload and make the return type of the const overload non-const. This patch also makes the ASSERT_NOT_NOEXCEPT tests libc++ specific, since other implementations may be free to strengthen the specification. llvm-svn: 303895
* Add <experimental/coroutine>Eric Fiselier2017-05-252-0/+267
| | | | | | | This patch adds the library portions of the coroutines PDTS, which should now be supported by Clang. llvm-svn: 303836
* Fix GCC 7 test failures.Eric Fiselier2017-05-091-6/+7
| | | | | | | | | | | This patch fixes the test failures and unexpected passes that occur when testing against GCC 7. Specifically: * don't mark __gcd as always inline because it's a recursive function. GCC diagnoses this. * don't XFAIL the aligned allocation tests. GCC 7 supports them but not the -faligned-allocation option. * Work around gcc.gnu.org/PR78489 in variants constructors. llvm-svn: 302488
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-042-4/+7
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* Diagnose when reverse_iterator is used on path::iterator.Eric Fiselier2017-04-131-10/+2
| | | | | | | | | | | | | | | 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
* Work around recent -Wshadow changes in ClangEric Fiselier2017-04-041-0/+11
| | | | llvm-svn: 299407
* Implement LWG 2787 - [file_status.cons] is inconsistentEric Fiselier2017-03-061-2/+4
| | | | llvm-svn: 297071
* remove max_size() extension from polymorphic_allocator. It is unneededEric Fiselier2017-03-021-6/+6
| | | | llvm-svn: 296831
* Make lcm/gcd work better in edge cases. Fixes a UBSAN failure.Marshall Clow2017-02-101-11/+16
| | | | llvm-svn: 294779
* Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are ↵Marshall Clow2017-02-051-1/+1
| | | | | | noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today. llvm-svn: 294142
* Change the base class of std::bad_optional_access. This is a (subtle) ABI ↵Marshall Clow2017-02-051-1/+1
| | | | | | change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error. llvm-svn: 294133
* experimental: remove some extraneous _LIBCPP_FUNC_VISSaleem Abdulrasool2017-01-301-14/+13
| | | | | | | | | | These member functions were decorated with `_LIBCPP_FUNC_VIS` when the class is also decorated with external visibility. This breaks down when building for PE/COFF, where the member function cannot be decorated if it is within a decorated class. The class attribute will propagate to the member. Remove the extraneous decoration. llvm-svn: 293454
* experimental: tolerate the existence of a `__deref` macroSaleem Abdulrasool2017-01-301-6/+9
| | | | | | | | Microsoft's SAL has a `__deref` macro which results in a compilation failure when building the filesystem module on Windows. Rename the member function internally to avoid the conflict. llvm-svn: 293449
* Implement LWG2733: [fund.ts.v2] gcd / lcm and bool. We already did tbis for ↵Marshall Clow2017-01-241-0/+4
| | | | | | C++17, so replicate the changes in experimental. llvm-svn: 292962
* Fix filesystem::path assignment from {}Eric Fiselier2017-01-181-0/+1
| | | | | | | | Adding `path::operator=(string_type&&)` made the expression `p = {}` ambiguous. This path fixes that ambiguity by making the `string&&` overload a template so it ranks lower during overload resolution. llvm-svn: 292345
* Revert "Rework fix for PR19460 - Use explicit bool as an extension instead."Eric Fiselier2017-01-131-6/+1
| | | | | | This reverts commit 3a1b90a866b6d5d62a5f37fbfb3a1ee36cc70dd1. llvm-svn: 291921
* Replace identifiers called `__out` because Windows.h #defines it.Eric Fiselier2017-01-072-7/+7
| | | | | | | | Windows is greedy and it defines the identifier `__out` as a macro. This patch renames all conflicting libc++ identifiers in order to correctly work on Windows. llvm-svn: 291345
* [libc++] Tolerate presence of __deallocate macroEric Fiselier2017-01-071-8/+5
| | | | | | | | | | | | | | | Summary: On Windows the identifier `__deallocate` is defined as a macro by one of the Windows system headers. Previously libc++ worked around this by `#undef __deallocate` and generating a warning. However this causes the WIN32 version of `__threading_support` to always generate a warning on Windows. This is not OK. This patch renames all usages of `__deallocate` internally as to not conflict with the macro. Reviewers: mclow.lists, majnemer, rnk, rsmith, smeenai, compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28426 llvm-svn: 291332
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-047-15/+15
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Rework fix for PR19460 - Use explicit bool as an extension instead.Eric Fiselier2017-01-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | In the previous fix I used a PMF type as a semi-safe bool type in C++03. However immediately after committing I realized clang offered explicit conversion operators as an extension. This patch removes the old fix and enables _LIBCPP_EXPLICIT using __has_extension instead. This change also affects the following other classes, which have '_LIBCPP_EXPLICIT operator bool()'. * shared_ptr * unique_ptr * error_condition * basic_ios * function (already C++11 only) * istream::sentry * experimental::string_view. In all of the above cases I believe it is safe to enable the extension, except in the experimental::string_view case. There seem to be some Clang bugs affecting the experimental::string_view conversion to std::basic_string. To work around that I manually disabled _LIBCPP_EXPLICIT in that case. llvm-svn: 290831
* Fix unused parameters and variablesEric Fiselier2016-12-232-4/+8
| | | | llvm-svn: 290459
* Implement conjuntion/disjuntion/negation for LFTS v2. Same code and tests ↵Marshall Clow2016-11-261-0/+18
| | | | | | for the ones in std:: llvm-svn: 287988
* Implement the 'detection idiom' from LFTS v2Marshall Clow2016-11-261-0/+85
| | | | llvm-svn: 287981
* Optimize filesystem::path by providing weaker exception guarantees.Eric Fiselier2016-10-311-2/+12
| | | | | | | | | | | | | | path uses string::append to construct, append, and concatenate paths. Unfortunatly string::append has a strong exception safety guaranteed and if it can't prove that the iterator operations don't throw then it will allocate a temporary string copy to append to. However this extra allocation and copy is very undesirable for path which doesn't have the same exception guarantees. To work around this this patch adds string::__append_forward_unsafe which exposes the std::string::append interface for forward iterators without enforcing that the iterator is noexcept. llvm-svn: 285532
* Improve performance of constructing filesystem::path from strings.Eric Fiselier2016-10-301-3/+4
| | | | | | | | | | | | | This patch fixes a performance bug when constructing or appending to a path from a string or c-string. Previously we called 'push_back' to append every single character. This caused multiple re-allocation and copies when at most one reallocation is necessary. The new behavior is to simply call `string::append` so it can correctly handle reallocation. For large strings this change is a ~4x improvement. This also makes our path faster to construct than libstdc++'s. llvm-svn: 285530
* Rewrite std::filesystem::path iterators and parserEric Fiselier2016-10-301-6/+19
| | | | | | | | | | | | | | | | | | | | | | This patch entirely rewrites the parsing logic for paths. Unlike the previous implementation this one stores information about the current state; For example if we are in a trailing separator or a root separator. This avoids the need for extra lookahead (and extra work) when incrementing or decrementing an iterator. Roughly this gives us a 15% speedup over the previous implementation. Unfortunately this implementation is still a lot slower than libstdc++'s. Because libstdc++ pre-parses and splits the path upon construction their iterators are trivial to increment/decrement. This makes libc++ lazy parsing 100x slower than libstdc++. However the pre-parsing libstdc++ causes a ton of extra and unneeded allocations when constructing the string. For example `path("/foo/bar/")` would require at least 5 allocations with libstdc++ whereas libc++ uses only one. The non-allocating behavior is much preferable when you consider filesystem usages like 'exists("/foo/bar/")'. Even then libc++'s path seems to be twice as slow to simply construct compared to libstdc++. More investigation is needed about this. llvm-svn: 285526
* Fix use of non-constexpr C++14 addressofEric Fiselier2016-10-161-1/+1
| | | | llvm-svn: 284325
* Update status for std::optional LWG issues and fix an optional SFINAE bugEric Fiselier2016-10-161-0/+4
| | | | llvm-svn: 284323
OpenPOWER on IntegriCloud