| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Under -fno-exceptions TEST_THROW becomes abort / __builtin_abort which returns
void. This causes a type mismatch in the conditional operator when testing the
library in C++98,03,11 modes.
Use a comma operator to workaround this problem.
Differential Revision: https://reviews.llvm.org/D26147
llvm-svn: 285572
|
|
|
|
|
|
| |
Reviewed at: https://reviews.llvm.org/D25958
llvm-svn: 285213
|
|
|
|
| |
llvm-svn: 284942
|
|
|
|
| |
llvm-svn: 284322
|
|
|
|
| |
llvm-svn: 284006
|
|
|
|
| |
llvm-svn: 284004
|
|
|
|
| |
llvm-svn: 283999
|
|
|
|
| |
llvm-svn: 283996
|
|
|
|
| |
llvm-svn: 283994
|
|
|
|
| |
llvm-svn: 283993
|
|
|
|
| |
llvm-svn: 283983
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Adapt implementation of Library Fundamentals TS optional into an implementation of N4606 optional.
- Update relational operators per http://wg21.link/P0307
- Update to requirements of http://wg21.link/P0032
- Extension: Implement trivial copy/move construction/assignment for `optional<T>` when `T` is trivially copyable.
Audit P/Rs for optional LWG issues:
- 2756 "C++ WP optional<T> should 'forward' T's implicit conversions" Implemented, which also resolves 2753 "Optional's constructors and assignments need constraints" (modulo my refusal to explicitly delete the move operations, which is a design error that I'm working on correcting in the 2756 P/R).
- 2736 "nullopt_t insufficiently constrained" Already conforming. I've added a test ensuring that `nullopt_t` is not copy-initializable from an empty braced-init-list, which I believe is the root intent of the issue, to avoid regression.
- 2740 "constexpr optional<T>::operator->" Already conforming.
- 2746 "Inconsistency between requirements for emplace between optional and variant" No P/R, but note that the author's '"suggested resolution" is already implemented.
- 2748 "swappable traits for optionals" Already conforming.
- 2753 "Optional's constructors and assignments need constraints" Implemented.
Most of the work for this patch was done by Casey Carter @ Microsoft. Thank you Casey!
Reviewers: mclow.lists, CaseyCarter, EricWF
Differential Revision: https://reviews.llvm.org/D22741
llvm-svn: 283980
|
|
|
|
| |
llvm-svn: 283978
|
|
|
|
|
|
|
|
| |
This patch is largely thanks to Casey Carter @ Microsoft. He did the initial
work of porting our experimental implementation and tests over to namespace
std.
llvm-svn: 283977
|
|
|
|
| |
llvm-svn: 283632
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
To quote STL the problems with stack allocator are"
>"stack_allocator<T, N> is seriously nonconformant to N4582 17.6.3.5 [allocator.requirements].
> First, it lacks a rebinding constructor. (The nested "struct rebind" isn't sufficient.)
> Second, it lacks templated equality/inequality.
> Third, it completely ignores alignment.
> Finally, and most severely, the Standard forbids its existence. Allocators are forbidden from returning memory "inside themselves". This requirement is implied by the Standard's requirements for rebinding and equality. It's permitted to return memory from a separate buffer object on the stack, though."
This patch attempts to address all of those issues.
First, instead of storing the buffer inside the allocator I've change `stack_allocator` to accept the buffer as an argument.
Second, in order to fix rebinding I changed the parameter list from `<class T, size_t NumElements>` to `<class T, size_t NumBytes>`. This allows allocator rebinding
between types that have different sizes.
Third, I added copy and rebinding constructors and assignment operators.
And finally I fixed the allocation logic to always return properly aligned storage.
Reviewers: mclow.lists, howard.hinnant, STL_MSFT
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25154
llvm-svn: 283631
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix self-swap. Patch from Casey Carter.
* Remove workarounds and tests for types with deleted move constructors. This
was originally added as part of a LWG proposed resolution that has since
changed.
* Re-apply most recent PR for LWG 2769.
* Re-apply most recent PR for LWG 2754. Specifically fix the SFINAE checks to
use the decayed type.
* Fix tests to allow moved-from std::any's to have a non-empty state. This is
the behavior of MSVC's std::any.
* Various whitespace and test fixes.
llvm-svn: 283606
|
|
|
|
| |
llvm-svn: 283580
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: There's a macro scheme already being used for __has_feature etc. Use it for __has_include too, which makes MSVC happy (it doesn't support __has_include yet, and unguarded use explodes horribly).
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25251
llvm-svn: 283260
|
|
|
|
| |
llvm-svn: 283030
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Libc++ still uses per-feature configuration macros when configuring for C++11. However libc++ requires a feature-complete C++11 compiler so there is no reason to check individual features. This patch starts the process of removing the feature specific macros and replacing their usage with `_LIBCPP_CXX03_LANG`.
This patch removes the __config macros:
* _LIBCPP_HAS_NO_TRAILING_RETURN
* _LIBCPP_HAS_NO_TEMPLATE_ALIASES
* _LIBCPP_HAS_NO_ADVANCED_SFINAE
* _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
* _LIBCPP_HAS_NO_STATIC_ASSERT
As a drive I also changed our C++03 static_assert to use _Static_assert if available.
I plan to commit this without review if nobody voices an objection.
Reviewers: mclow.lists
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24895
llvm-svn: 282347
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch further decouples libc++ from pthread, allowing libc++ to be built
against other threading systems. There are two main use cases:
- Building libc++ against a thread library other than pthreads.
- Building libc++ with an "external" thread API, allowing a separate library to
provide the implementation of that API.
The two use cases are quite similar, the second one being sligtly more
de-coupled than the first. The cmake option LIBCXX_HAS_EXTERNAL_THREAD_API
enables both kinds of builds. One needs to place an <__external_threading>
header file containing an implementation of the "libc++ thread API" declared
in the <__threading_support> header.
For the second use case, the implementation of the libc++ thread API can
delegate to a custom "external" thread API where the implementation of this
external API is provided in a seperate library. This mechanism allows toolchain
vendors to distribute a build of libc++ with a custom thread-porting-layer API
(which is the "external" API above), platform vendors (recipients of the
toolchain/libc++) are then required to provide their implementation of this API
to be linked with (end-user) C++ programs.
Note that the second use case still requires establishing the basic types that
get passed between the external thread library and the libc++ library
(e.g. __libcpp_mutex_t). These cannot be opaque pointer types (libc++ sources
won't compile otherwise). It should also be noted that the second use case can
have a slight performance penalty; as all the thread constructs need to cross a
library boundary through an additional function call.
When the header <__external_threading> is omitted, libc++ is built with the
"libc++ thread API" (declared in <__threading_support>) as the "external" thread
API (basic types are pthread based). An implementation (pthread based) of this
API is provided in test/support/external_threads.cpp, which is built into a
separate DSO and linked in when running the libc++ test suite. A test run
therefore demonstrates the second use case (less the intermediate custom API).
Differential revision: https://reviews.llvm.org/D21968
Reviewers: bcraig, compnerd, EricWF, mclow.lists
llvm-svn: 281179
|
|
|
|
| |
llvm-svn: 280608
|
|
|
|
|
|
|
|
| |
This patch implements the std::sample function added to C++17 from LFTS. It
also removes the std::experimental::sample implementation which now forwards
to std::sample.
llvm-svn: 279948
|
|
|
|
| |
llvm-svn: 279945
|
|
|
|
| |
llvm-svn: 278904
|
|
|
|
| |
llvm-svn: 278736
|
|
|
|
| |
llvm-svn: 278319
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds std::any by moving/adapting <experimental/any>.
This patch also implements the std::any parts of p0032r3 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf)
and LWG 2509 (http://cplusplus.github.io/LWG/lwg-defects.html#2509).
I plan to push it in a day or two if there are no comments.
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D22733
llvm-svn: 278310
|
|
|
|
|
|
|
| |
Previously the copy/move constructors of the test types did not
properly set the arg_id to T const& or T&& respectivly.
llvm-svn: 277970
|
|
|
|
|
|
| |
STL@microsoft.com
llvm-svn: 277572
|
|
|
|
| |
llvm-svn: 276605
|
|
|
|
| |
llvm-svn: 276544
|
|
|
|
|
|
| |
clang/apple-clang.
llvm-svn: 276200
|
|
|
|
| |
llvm-svn: 275754
|
|
|
|
|
|
| |
Fixes PR#28412. Thanks to Jonathan Wakely for the report.
llvm-svn: 275105
|
|
|
|
| |
llvm-svn: 273840
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the weak_type typedef in shared_ptr. It is available in
C++17 and newer.
This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to
have the value of 16, since 2016 is the current year.
llvm-svn: 273839
|
|
|
|
| |
llvm-svn: 273838
|
|
|
|
| |
llvm-svn: 273819
|
|
|
|
| |
llvm-svn: 273384
|
|
|
|
| |
llvm-svn: 273383
|
|
|
|
| |
llvm-svn: 273382
|
|
|
|
|
|
|
|
|
|
| |
So the macros TEST_HAS_NO_EXCEPTIONS and TEST_HAS_NO_RTTI were always
getting defined because I spelt __cpp_exceptions and __cpp_rtti as
__cxx_exceptions and __cxx_rtti.
Tests incoming after this patch.
llvm-svn: 273381
|
|
|
|
| |
llvm-svn: 273371
|
|
|
|
| |
llvm-svn: 273350
|
|
|
|
|
|
|
|
| |
The filesystem tests were expecting the paths to the build/source directories
did not contain any symlinks. This patch resolves those symlinks before running
the test suite.
llvm-svn: 273323
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
An implementation of std::experimental::propagate_const from Library Fundamentals Technical Specification v2.
No tests are provided for disallowed types like fancy pointers or function pointers as no code was written to handle these.
Reviewers: EricWF, mclow.lists
Differential Revision: http://reviews.llvm.org/D12486
llvm-svn: 273122
|
|
|
|
|
|
|
|
| |
Single threaded builds often don't provide a monotonic clock, so we can't
always provide a monotonic SleepFor(...) implementation. Hopefully this
won't cause the builds to hang.
llvm-svn: 273091
|
|
|
|
| |
llvm-svn: 273089
|