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

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I guess this can serve as a run-time testcase:

#include <utility>

struct C { int i; };
struct A {
  operator C() & { return { 1 }; }
  operator C() && { return { 2 }; }
};

C f(A a)
{
  return a;
}

C f2(A a)
{
  return std::move (a);
}

int
main ()
{
  C c1 = f (A());
  if (c1.i != 1)
    __builtin_abort ();
  C c2 = f2 (A());
  if (c2.i != 2)
    __builtin_abort ();
}

Reply via email to