https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128769
--- Comment #11 from Jamaika <lukaszcz18 at wp dot pl> ---
In file included from variant_non_member.h:3,
from variant_storage.h:3,
from variant.h:3,
from tests.cpp:9:
details.h: In instantiation of 'Last details::overloader<T,
Last>::operator()(Last) requires Overloadable<T, Last, Last[]> [with T =
double&; Last = std::reference_wrapper<double>]':
C:/gcc1700/include/c++/17.0.0/type_traits:2916:26: required by substitution
of 'template<class _Fn, class ... _Args> static
std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)),
std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn =
details::overloader<double&, int, std::reference_wrapper<double> >; _Args =
{double&}]'
2916 | std::declval<_Fn>()(std::declval<_Args>()...)
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/gcc1700/include/c++/17.0.0/type_traits:2927:60: required from 'struct
std::__result_of_impl<false, false, details::overloader<double&, int,
std::reference_wrapper<double> >, double&>'
2927 | using type = decltype(_S_test<_Functor, _ArgTypes...>(0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
C:/gcc1700/include/c++/17.0.0/type_traits:2932:12: required from 'struct
std::__invoke_result<details::overloader<double&, int,
std::reference_wrapper<double> >, double&>'
2932 | struct __invoke_result
| ^~~~~~~~~~~~~~~
C:/gcc1700/include/c++/17.0.0/type_traits:3413:12: required from 'struct
std::invoke_result<details::overloader<double&, int,
std::reference_wrapper<double> >, double&>'
3413 | struct invoke_result
| ^~~~~~~~~~~~~
C:/gcc1700/include/c++/17.0.0/type_traits:3425:11: required by substitution
of 'template<class _Fn, class ... _Args> using std::invoke_result_t = typename
std::invoke_result::type [with _Fn = details::overloader<double&, int,
std::reference_wrapper<double> >; _Args = {double&}]'
3425 | using invoke_result_t = typename invoke_result<_Fn,
_Args...>::type;
| ^~~~~~~~~~~~~~~
details.h:207:7: required by substitution of 'template<class T, class ...
Types> using details::get_best_match_t =
std::invoke_result_t<details::overloader<T, Types ...>, T> [with T = double&;
Types = {int, std::reference_wrapper<double>}]'
207 | using get_best_match_t = std::invoke_result_t<overloader<T, Types...>,
T>;
| ^~~~~~~~~~~~~~~~
variant.h:33:25: required by substitution of 'template<class T, class U>
constexpr variant<int, std::reference_wrapper<double> >::variant(T&&) requires
!(SameWithoutSvref<T, variant<Types ...> >) && !(InPlaceTypeT<T>) &&
!(InPlaceIndexT<T>) && (OneInTypes<U, Types ...>) [with T = double&; U =
<missing>]'
33 | template <typename T, typename U = details::get_best_match_t<T,
Types...>>
| ^~~~~~~~
tests.cpp:293:54: required from here
293 | variant<int, std::reference_wrapper<double>> y = d;
| ^
details.h:188:3: error: elements of array 'class std::reference_wrapper<double>
[]' have incomplete type
188 | ToArray{std::forward<From>(t)};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests.cpp: In member function 'virtual void
correctness_alternative_selection_Test::TestBody()':
tests.cpp:293:54: error: conversion from 'double' to non-scalar type
'variant<int, std::reference_wrapper<double> >' requested
293 | variant<int, std::reference_wrapper<double>> y = d;
| ^