summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Last commit included some extra constexpr; remove themMarshall Clow2017-05-251-3/+3
| | | | llvm-svn: 303862
* Make for_each_n only avaliable on C++17Marshall Clow2017-05-251-3/+5
| | | | llvm-svn: 303856
* Remove <experimental/coroutine> from the module map for now. It doesn't work ↵Eric Fiselier2017-05-251-4/+6
| | | | | | unless modules are enabled llvm-svn: 303838
* Add <experimental/coroutine>Eric Fiselier2017-05-253-0/+271
| | | | | | | This patch adds the library portions of the coroutines PDTS, which should now be supported by Clang. llvm-svn: 303836
* Add non-parallel version of for_each_n (+tests) from the Parallelism TSMarshall Clow2017-05-251-0/+21
| | | | llvm-svn: 303833
* Implement LWG#2790: Remove istreambuf_iterator::operator->. It never did ↵Marshall Clow2017-05-231-1/+0
| | | | | | anything useful. llvm-svn: 303675
* Make next/prev/advance/distance operations on iterators be constexpr. I ↵Marshall Clow2017-05-171-14/+23
| | | | | | missed this when I implemented the rest of P0031R0 llvm-svn: 303281
* Mark the copy constructor and move Marshall Clow2017-05-171-2/+2
| | | | | | constructor to be constexpr. This only works when the contained type has a constexpr copy/move ctor. llvm-svn: 303268
* Remove non-standard basic_string_view::clear() member.Eric Fiselier2017-05-121-8/+0
| | | | | | | | This patch removes the clear() member from <string_view>. The modifier was removed from the TS before it ever landed in the standard. There is no reason libc++ should be providing this method. llvm-svn: 302869
* Replace a nested namespace used for overload resolution with a struct. ↵Marshall Clow2017-05-111-2/+2
| | | | | | Richard Smith says that using the namespace results in an ODR violation, but I disagree. Nevertheless, the struct works just as well. llvm-svn: 302800
* Fix `std::visit` for the zero variants case.Michael Park2017-05-111-16/+7
| | | | | | | | | | | | | | | | | Summary: The following code is broken: ``` std::visit([]{}); ``` Reviewers: EricWF Reviewed By: EricWF Differential Revision: https://reviews.llvm.org/D33090 llvm-svn: 302773
* Remove usages of _LIBCPP_MSVC which is never definedEric Fiselier2017-05-104-5/+5
| | | | llvm-svn: 302736
* Fix MinGW build to use Pthread when the header is available.Eric Fiselier2017-05-101-1/+8
| | | | | | | | | | | | | Some MinGW configurations use WinPThread instead of the native threading interfaces. When this happens libc++ doesn't build because it tries to use the wrong threading API. This patch attempts to correctly detect and enable pthreads; Selecting them when __MINGW32__ is defined and __has_include(<pthread.h>) is true. I'm not sure if this works correctly 100% of the time but it seemed like the most correct approach available. llvm-svn: 302734
* Don't interfere with the __builtin_foo namespace under MSVCEric Fiselier2017-05-102-178/+103
| | | | | | | | | This patch follows up on feedback received in the review for D32988. Specifically that libc++ should not mess with the __builtin namespace, and that libc++ should use __popcnt to implement __pop_count under MSVC. llvm-svn: 302731
* [libc++] Refactor Windows support headers.Eric Fiselier2017-05-1012-110/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch refactors and tries to remove as much of the Windows support headers as possible. This is needed because they currently introduce super weird include cycles and dependencies between STL and libc headers. The changes in this patch are: * remove `support/win32/support.h` completely. The required parts have either been moved into `support/win32/msvc_support.h` (for `MSVC` only helpers not needed by Clang), or directly into their respective `foo.h` headers. * Combine `locale_win32.h` and `locale_mgmt_win32.h` into a single headers, this header should only be included within `__locale` or `locale` to avoid include cycles. * Remove the unneeded parts of `limits_win32.h` and re-name it to `limits_msvc_win32.h` since it's only needed by Clang. I've tested this patch using Clang on Windows, but I suspect it might technically regress our non-existent support for MSVC. Is somebody able to double check? This refactor is needed to support upcoming fixes to `<locale>` on Windows. Reviewers: bcraig, rmaprath, compnerd, EricWF Reviewed By: EricWF Subscribers: majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D32988 llvm-svn: 302727
* [libc++] Fix PR32979 - types with a private std::enable_shared_from_this ↵Eric Fiselier2017-05-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | base break shared_ptr Summary: This patch fixes bugs.llvm.org/PR32979. [util.smartptr.shared.const] says: > In the constructor definitions below, enables shared_from_this with p, for a pointer p of type Y*, means > that if Y has an unambiguous and accessible base class that is a specialization of enable_shared_from_- > this. This means that libc++ needs to respect the access specifier of the base class, and not attempt to construct and enabled_shared_from_this base if it is private. However access specifiers don't affect overload resolution so our current implementation will attempt to construct the private base. This patch uses SFINAE to correctly detect if the shared_ptr input has an accessible enable_shared_from_this base class. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33033 llvm-svn: 302709
* Support using MinGW POSIX threads on WindowsEric Fiselier2017-05-101-1/+2
| | | | llvm-svn: 302617
* Fix GCC 7 test failures.Eric Fiselier2017-05-093-12/+14
| | | | | | | | | | | 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
* Refactor <locale> RAII guards to aid upcoming Windows locale changes.Eric Fiselier2017-05-083-20/+33
| | | | | | | | | | | | | | | | | | | Previously <locale> used std::unique_ptr<remove_ptr<locale_t>, locale-mgmt-function> as a scope guard for (A) creating new locales, and (B) setting the thread specific locale in RAII safe manner. However using unique_ptr has some problems, first it requires that locale_t is a pointer type, which may not be the case (Windows will need a non-pointer locale_t type that emulates _locale_t). The second problem is that users of the guards had to supply the locale management function to the custom deleter at every call site. However these locale management functions don't exist natively Windows, making a good Windows implementation of locale more difficult. This patch creates distinct and simply RAII guards that replace unique_ptr. These guards handle calling the correct locale management function so that callers don't have too. This simplification will aid in upcoming Windows fixes. llvm-svn: 302474
* Fix shared_mutex dll import errors on WindowsEric Fiselier2017-05-081-1/+1
| | | | llvm-svn: 302394
* [libc++] Implement exception_ptr on WindowsEric Fiselier2017-05-081-3/+54
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC. The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well. Note there are still 2 outstanding exception_ptr/nested_exception test failures. * `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time. * `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion. This patch also gets most of the `<future>` tests passing as well. Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D32927 llvm-svn: 302393
* Fix DLL import/export on Win32 locale helpersEric Fiselier2017-05-081-3/+4
| | | | llvm-svn: 302391
* Fix DLL import for __time_get_c_storage member functions.Eric Fiselier2017-05-081-0/+16
| | | | llvm-svn: 302390
* Ensure showbase does not overflow do_put buffersDimitry Andric2017-05-061-0/+4
| | | | | | | | | | | | | | | | | | | | | Summary: In https://bugs.freebsd.org/207918, Daniel McRobb describes how using std::showbase with ostreams can cause truncation of unsigned long long when output format is octal. In fact, this can even happen with unsigned int and unsigned long. To ensure this does not happen, add one additional character to the do_put buffers if std::showbase is on. Also add a test case. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D32670 llvm-svn: 302362
* Fix lgamma_r linking errors on Windows. It appears the normal lgamma ↵Eric Fiselier2017-05-061-4/+14
| | | | | | function is thread safe anyway llvm-svn: 302330
* Fix condition_variable::wait_until and wait_for on Windows.Eric Fiselier2017-05-051-1/+4
| | | | | | | | The ERROR_TIMEDOUT returned by the Windows API does not have the same value as ETIMEDOUT. This caused condition_variable to return timeouts as unknown errors. llvm-svn: 302297
* Fix detection for [[fallthrough]] with GCCEric Fiselier2017-05-051-1/+1
| | | | llvm-svn: 302285
* Fix new warnings emitted by GCC 7Eric Fiselier2017-05-052-1/+8
| | | | llvm-svn: 302280
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-0413-39/+140
| | | | | | | | | | | | | | | 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
* Use lgamma_r instead of lgamma in binomial_distribution, because freakin' ↵Marshall Clow2017-05-041-4/+8
| | | | | | POSIX took a perfectly fine call and made it not thread safe. llvm-svn: 302168
* Use nullptr instead of the literal 0Eric Fiselier2017-05-041-1/+1
| | | | llvm-svn: 302100
* Fix macro redefinition warnings for _LIBCPP_NO_RTTIEric Fiselier2017-05-041-1/+1
| | | | llvm-svn: 302099
* Qualify calls to __invoke, __apply_fuctor, and __muEric Fiselier2017-05-031-3/+3
| | | | llvm-svn: 302082
* Add missing acquire_load to call_once overload.Justin Lebar2017-04-231-1/+1
| | | | | | | | | | | | Summary: Seemed to have been overlooked in D24028. This bug was found and brought to my attention by Paul Wankadia. Reviewers: kubamracek, EricWF, dvyukov Differential Revision: https://reviews.llvm.org/D32402 llvm-svn: 301132
* cmath: Skip Libc for integral types in isinf, etc.Duncan P. N. Exon Smith2017-04-211-8/+81
| | | | | | | | | | | | | | | | | | | | | | | | For std::isinf, the standard requires effectively calling isinf as double from Libc for integral types. But integral types are never infinite; we don't need to call Libc to return false. Also short-circuit other functions where Libc won't have interesting answers: signbit, fpclassify, isfinite, isnan, and isnormal. I added correctness tests for integral types since we're no longer deferring to Libc. In review it was pointed out that in future revisions of the C++ standard we may add more types to std::is_arithmetic (e.g., std::is_fixed_point). I'll leave it to a future commit to hack this to allow using math functions on those. We'll need to change things like __libcpp_fpclassify anyway, so I'm not sure anything here would really be future-proof. https://reviews.llvm.org/D31561 rdar://problem/31361223 llvm-svn: 301060
* Fix ATOMIC_<TYPE>_LOCK_FREE macros on Windows.Eric Fiselier2017-04-201-10/+23
| | | | | | | | | | | | Previously the ATOMIC_<TYPE>_LOCK_FREE macros were implemented using __GCC_ATOMIC_<TYPE>_LOCK_FREE but GCC specific macros are defined when -fms-compatibility is specified. To avoid this Libc++ now tries to use the newly added __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros instead, and only falls back to the GCC versions when the Clang ones aren't available. llvm-svn: 300920
* Fix dllimport on a class templateEric Fiselier2017-04-201-1/+1
| | | | llvm-svn: 300808
* Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>Eric Fiselier2017-04-191-8/+8
| | | | llvm-svn: 300649
* Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, ↵Eric Fiselier2017-04-194-19/+19
| | | | | | <locale>, and <iterator> llvm-svn: 300648
* Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in the functional ↵Eric Fiselier2017-04-192-18/+14
| | | | | | library llvm-svn: 300646
* Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utilityEric Fiselier2017-04-193-34/+22
| | | | llvm-svn: 300644
* Cleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headersEric Fiselier2017-04-194-27/+19
| | | | llvm-svn: 300643
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.Eric Fiselier2017-04-191-30/+28
| | | | llvm-svn: 300633
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headersEric Fiselier2017-04-192-68/+56
| | | | llvm-svn: 300632
* Cleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regexEric Fiselier2017-04-181-11/+11
| | | | llvm-svn: 300627
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output libraryEric Fiselier2017-04-185-67/+54
| | | | llvm-svn: 300626
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithmEric Fiselier2017-04-181-9/+9
| | | | llvm-svn: 300625
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_listEric Fiselier2017-04-181-2/+2
| | | | llvm-svn: 300623
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.Eric Fiselier2017-04-183-45/+41
| | | | llvm-svn: 300622
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and ↵Eric Fiselier2017-04-181-85/+47
| | | | | | | | std::unordered_multimap This completes the cleanup of the containers, at least within the tests. llvm-svn: 300620
OpenPOWER on IntegriCloud