https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92662

--- Comment #1 from Michael Matz <matz at gcc dot gnu.org> ---
I _think_ a reduced program would be this:

-----------------------------------------
template<typename _Tp> struct remove_ref { typedef _Tp type; };
template<typename _Tp> struct remove_ref<_Tp&> { typedef _Tp type; };
template<typename _Tp> struct remove_ref<_Tp&&> { typedef _Tp type; };

template<typename _Tp> 
typename remove_ref<_Tp>::type&&
moveme(_Tp&& __t) noexcept;

struct S
{
  S();
};

struct Test
{
  S const& str() const&;
  S &&     str() &&    ;

  operator S const&() const&;
  operator S &&    () &&    ;
};

int main()
{
  Test t;
  S a { moveme(t).str() };
  S b { moveme(t) };
  return 0;
}
-----------------------------------------

at least it gives same behaviour and captures the structure of the involved
move() functions.

% gcc-8 -c xreduced.cc
% gcc-9 -c xreduced.cc
x.cc: In function ‘int main()’:
x.cc:27:19: error: call of overloaded ‘S(<brace-enclosed initializer list>)’ is
ambiguous
   27 |   S b { moveme(t) };
      |                   ^
x.cc:9:8: note: candidate: ‘constexpr S::S(const S&)’
    9 | struct S
      |        ^
x.cc:9:8: note: candidate: ‘constexpr S::S(S&&)’

Reply via email to