diff options
author | mikhnenko <[email protected]> | 2025-02-01 14:09:02 +0300 |
---|---|---|
committer | mikhnenko <[email protected]> | 2025-02-01 14:33:00 +0300 |
commit | 5ef4578b282eef07d27f8d0cb56d2c1aac00042c (patch) | |
tree | 1fbf9195e0b8c4e47bd7f84aba089ba3c13474f3 /contrib/libs/cxxsupp/libcxx/include/variant | |
parent | 6be27609101cab343f3fedd9204990737b6ecddd (diff) |
Update libcxx to 2 Apr 2024 239236b8c2154aa49e98bc7ed774a7d2712edf50
```
[libc++] Remove pair dependency (#85621)
[libc++] Simplify the implementation of <stddef.h> (#86843)
Update the "Current Status" section of the website to be current. (#84507)
[libc++] Optimize the two range overload of mismatch (#86853)
[libc++] Refactor __tuple_like and __pair_like (#85206)
[libc++][test] Improves src include paths. (#86864)
[libc++] Document guidelines for applying [[nodiscard]] (#84000)
[libc++] Optimize the std::mismatch tail (#83440)
[libc++] Remove <queue> and <stack> includes from <format> (#85520)
[libc++] Switch FreeBSD to C++26 (#86658)
[libc++] Fix one case in saturate_cast.pass.cpp for 64-bit on z/OS (#86724)
[libc++][test] Remove tests that testing std::variant<T&> (#84222)
[libc++] <experimental/simd> Reduce types for template parameter U in tests (#83781)
[libc++] Switch FreeBSD CI job to Clang 17 (#86320)
[libc++][CI] Updates the documentation. (#85264)
[libc++][format] Adds ABI tags to inline constexpr variables. (#86293)
[libc++][test] Fix race condition in condition_variable_any tests (#84788)
[libc++] Vectorize mismatch (#73255)
[libc++] Don't push and pop extensions diagnostics when using clang modules (#85917)
[libc++][ranges] use `static operator()` for C++23 ranges (#86052)
[libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (#85263)
[libc++] Remove macros for keeping std::allocator members and void specialization after C++20 (#85806)
[libc++] Deprecates std::errc constants. (#80542)
[libcxx] [cmake] Fix cmake_path(ABSOLUTE_PATH) for empty CMAKE_INSTALL_PREFIX
[libc++][CI] Reenables the module tests. (#85799)
[libc++][ranges] remove `__workaround_52970` (#85683)
[libc++][ranges] LWG3715: `view_interface::empty` is overconstrained (#85004)
[libcxx] [modules] Fix relative paths with absolute LIBCXX_INSTALL_MODULES_DIR (#85756)
[libc++][format] Fixes nested concept evaluation. (#85548)
[libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85262)
[libc++] Remove __unconstrained_reverse_iterator (#85582)
[libc++] Simplify the implementation of remove_reference (#85207)
[libcxx][test] Create feature host-can-create-symlinks (#82204)
[libc++] Use __is_scoped_enum for the implementation of is_scoped_enum if it's available (#85580)
[libc++] Add missing hide-from-ABI annotations on virtual functions (#85439)
[libc++] Optimize ranges::fill{,_n} for vector<bool>::iterator (#84642)
[libc++] Add <locale> include in <chrono> (#85521)
[libc++] Remove <locale> includes from <format> (#85478)
[libc++] P2602R2 Poison Pills are Too Toxic (#74534)
[libc++] Fixes run-buildbot-container. (#84644)
[libc++] Add [[nodiscard]] to static numeric limit functions (#83748)
Rework Modules CMake to be (more) idiomatic. (#84936)
[libc++] Enables TZDB tests. (#82108)
[libc++] Remove a few includes from <__functional/hash.h> (#83254)
[libc++] Implements filebuf unbuffered. (#76629)
[libc++][CI] Updates the version number of the latest release.
[libc++] Remove <tuple> include from <__format/concepts.h> (#80214)
[runtimes] Prefer -fvisibility-global-new-delete=force-hidden (#84917)
[libc++] Fix tests on musl (#85085)
[libc++] Remove _LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT (#83928)
[libcxx] Fix incorrect type in the has-1024-bit-atomics feature test (#84904)
[libc++] Improves UB handling in ios_base destructor. (#76525)
[libc++][CI] Installs tzdata package in Docker. (#84643)
[libc++][TZDB] Fixes parsing interleaved rules. (#84808)
[libc++][hardening] Check bounds on arithmetic in __bounded_iter (#78876)
[libc++][hardening] Add iterator validity checks on unordered containers (#80230)
[libc++][hardening] Reclassify string_view(ptr, len)'s size assertion (#79297)
[libc++] Re-enable the clang_modules_include test for Objective-C++ (#66801)
[libc++] Remove XFAIL for SIMD in optimized build (#84767)
[libcxx] Update 128-bit-atomics feature test (#83841)
[libc++] Only forward-declare ABI-functions in exception_ptr.h if they are meant to be used (#84707)
[libc++][test] Don't include `test_format_context.h` in `parse.pass.cpp` (#83734)
[libc++] Add missing include in test (#84579)
[libc++] Remove <tuple> from <variant> (#83183)
[RFC][libc++] Reworks clang-tidy selection. (#81362)
[libc++] Remove <array> include from <span> (#83742)
[libc++][format] Updates LWG3462 status. (#80550)
[libc++][format] Update LWG3701 status. (#80545)
[libc++][test] Fix MSVC warning C4127 in `array.cons/initialization.pass.cpp` (#79793)
[libc++] Simplify the std::pair constructor overload set (#81448)
[libc++] Allow the use of extensions in the implementation (#79532)
[libc++] Don't build against libcxxrt by default on FreeBSD (#84484)
Actually disable the module generation tests.
[libc++] Disable module_std and module_std_compat tests
[libc++] Enable availability based on the compiler instead of __has_extension (#84065)
[libc++] Fixes time formatter test output for Linux on PowerPC (#75526)
[libc++] Remove unused includes from __type_traits/is_convertible.h (#83747)
```
commit_hash:171258d93ab92f516dfb1789300677a164e63219
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/variant')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/variant | 70 |
1 files changed, 27 insertions, 43 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/variant b/contrib/libs/cxxsupp/libcxx/include/variant index 5ce99250a8b..1b5e84e9547 100644 --- a/contrib/libs/cxxsupp/libcxx/include/variant +++ b/contrib/libs/cxxsupp/libcxx/include/variant @@ -221,27 +221,34 @@ namespace std { #include <__functional/operations.h> #include <__functional/unary_function.h> #include <__memory/addressof.h> +#include <__tuple/find_index.h> +#include <__tuple/sfinae_helpers.h> #include <__type_traits/add_const.h> #include <__type_traits/add_cv.h> #include <__type_traits/add_pointer.h> #include <__type_traits/add_volatile.h> +#include <__type_traits/common_type.h> +#include <__type_traits/conjunction.h> #include <__type_traits/dependent_type.h> #include <__type_traits/is_array.h> +#include <__type_traits/is_constructible.h> #include <__type_traits/is_destructible.h> -#include <__type_traits/is_nothrow_move_constructible.h> -#include <__type_traits/is_trivially_copy_assignable.h> -#include <__type_traits/is_trivially_copy_constructible.h> +#include <__type_traits/is_nothrow_assignable.h> +#include <__type_traits/is_nothrow_constructible.h> +#include <__type_traits/is_reference.h> +#include <__type_traits/is_trivially_assignable.h> +#include <__type_traits/is_trivially_constructible.h> #include <__type_traits/is_trivially_destructible.h> -#include <__type_traits/is_trivially_move_assignable.h> -#include <__type_traits/is_trivially_move_constructible.h> #include <__type_traits/is_void.h> #include <__type_traits/remove_const.h> +#include <__type_traits/remove_cvref.h> #include <__type_traits/type_identity.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> #include <__utility/forward.h> #include <__utility/forward_like.h> #include <__utility/in_place.h> +#include <__utility/integer_sequence.h> #include <__utility/move.h> #include <__utility/swap.h> #include <__variant/monostate.h> @@ -249,7 +256,6 @@ namespace std { #include <initializer_list> #include <limits> #include <new> -#include <tuple> #include <version> // standard-mandated includes @@ -340,21 +346,20 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> { inline constexpr size_t variant_npos = static_cast<size_t>(-1); -_LIBCPP_HIDE_FROM_ABI constexpr int __choose_index_type(unsigned int __num_elem) { - if (__num_elem < numeric_limits<unsigned char>::max()) - return 0; - if (__num_elem < numeric_limits<unsigned short>::max()) - return 1; - return 2; +template <size_t _NumAlternatives> +_LIBCPP_HIDE_FROM_ABI constexpr auto __choose_index_type() { +# ifdef _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION + if constexpr (_NumAlternatives < numeric_limits<unsigned char>::max()) + return static_cast<unsigned char>(0); + else if constexpr (_NumAlternatives < numeric_limits<unsigned short>::max()) + return static_cast<unsigned short>(0); + else +# endif // _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION + return static_cast<unsigned int>(0); } template <size_t _NumAlts> -using __variant_index_t = -# ifndef _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION - unsigned int; -# else - std::tuple_element_t< __choose_index_type(_NumAlts), std::tuple<unsigned char, unsigned short, unsigned int> >; -# endif +using __variant_index_t = decltype(std::__choose_index_type<_NumAlts>()); template <class _IndexType> constexpr _IndexType __variant_npos = static_cast<_IndexType>(-1); @@ -1081,13 +1086,9 @@ struct __narrowing_check { }; template <class _Dest, class _Source> -using __check_for_narrowing _LIBCPP_NODEBUG = typename _If< -# ifdef _LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT - false && -# endif - is_arithmetic<_Dest>::value, - __narrowing_check, - __no_narrowing_check >::template _Apply<_Dest, _Source>; +using __check_for_narrowing _LIBCPP_NODEBUG = + typename _If< is_arithmetic<_Dest>::value, __narrowing_check, __no_narrowing_check >::template _Apply<_Dest, + _Source>; template <class _Tp, size_t _Idx> struct __overload { @@ -1095,24 +1096,6 @@ struct __overload { auto operator()(_Tp, _Up&&) const -> __check_for_narrowing<_Tp, _Up>; }; -// TODO(LLVM-19): Remove all occurrences of this macro. -# ifdef _LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT -template <class _Tp, size_t> -struct __overload_bool { - template <class _Up, class _Ap = __remove_cvref_t<_Up>> - auto operator()(bool, _Up&&) const -> enable_if_t<is_same_v<_Ap, bool>, __type_identity<_Tp>>; -}; - -template <size_t _Idx> -struct __overload<bool, _Idx> : __overload_bool<bool, _Idx> {}; -template <size_t _Idx> -struct __overload<bool const, _Idx> : __overload_bool<bool const, _Idx> {}; -template <size_t _Idx> -struct __overload<bool volatile, _Idx> : __overload_bool<bool volatile, _Idx> {}; -template <size_t _Idx> -struct __overload<bool const volatile, _Idx> : __overload_bool<bool const volatile, _Idx> {}; -# endif - template <class... _Bases> struct __all_overloads : _Bases... { void operator()() const; @@ -1625,6 +1608,7 @@ _LIBCPP_POP_MACROS #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include <exception> +# include <tuple> # include <type_traits> # include <typeinfo> # include <utility> |