gcc/libstdc++-v3/testsuite/20_util/variant
Ville Voutilainen 669a6fdcb4 Rewrite variant, also PR libstdc++/85517
* include/std/variant (__do_visit): New.
(__variant_cast): Likewise.
(__variant_cookie): Likewise.
(__erased_*): Remove.
(_Variant_storage::_S_vtable): Likewise.
(_Variant_storage::__M_reset_impl): Adjust to use __do_visit.
(_Variant_storage::__M_reset): Adjust.
(__variant_construct): New.
(_Copy_ctor_base(const _Copy_ctor_base&)): Adjust to use
__variant_construct.
(_Move_ctor_base(_Move_ctor_base&&)): Likewise.
(_Move_ctor_base::__M_destructive_copy): New.
(_Move_ctor_base::__M_destructive_move): Adjust to use
__variant_construct.
(_Copy_assign_base::operator=): Adjust to use __do_visit.
(_Copy_assign_alias): Adjust to check both copy assignment
and copy construction for triviality.
(_Move_assign_base::operator=): Adjust to use __do_visit.
(_Multi_array): Add support for visitors that accept and return
a __variant_cookie.
(__gen_vtable_impl::_S_apply_all_alts): Likewise.
(__gen_vtable_impl::_S_apply_single_alt): Likewise.
(__gen_vtable_impl::__element_by_index_or_cookie): New. Generate
a __variant_cookie temporary for a variant that is valueless and..
(__gen_vtable_impl::__visit_invoke): ..adjust here.
(__gen_vtable::_Array_type): Conditionally make space for
the __variant_cookie visitor case.
(__variant_construct_by_index): New.
(get_if): Adjust to use std::addressof.
(relops): Adjust to use __do_visit.
(variant): Add __variant_cast and __variant_construct_by_index
as friends.
(variant::emplace): Use _M_reset() and __variant_construct_by_index
instead of self-destruction.
(variant::swap): Adjust to use __do_visit.
(visit): Reimplement in terms of __do_visit.
(__variant_hash_call_base_impl::operator()): Adjust to use __do_visit.
* testsuite/20_util/variant/compile.cc: Adjust.
* testsuite/20_util/variant/run.cc: Likewise.

From-SVN: r269422
2019-03-06 14:56:05 +02:00
..
80165.cc re PR libstdc++/80165 (Constexpr tuple of variant doesn't work) 2018-05-13 13:36:12 +03:00
85183.cc Update copyright years. 2019-01-01 13:31:55 +01:00
86874.cc Update copyright years. 2019-01-01 13:31:55 +01:00
87431.cc PR libstdc++/87431 fix regression introduced by r264574 2019-01-06 20:52:34 +00:00
87619.cc Update copyright years. 2019-01-01 13:31:55 +01:00
any.cc Update copyright years. 2019-01-01 13:31:55 +01:00
compile.cc Rewrite variant, also PR libstdc++/85517 2019-03-06 14:56:05 +02:00
deduction.cc Update copyright years. 2019-01-01 13:31:55 +01:00
hash.cc Update copyright years. 2019-01-01 13:31:55 +01:00
index_type.cc Update copyright years. 2019-01-01 13:31:55 +01:00
run.cc Rewrite variant, also PR libstdc++/85517 2019-03-06 14:56:05 +02:00