(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp0x/
elision_weak.C
// { dg-do compile }

struct S
{
  S() {}
  S(S&) {}
};

S f()
{
  S s;
  return s; // { dg-error "cannot bind non-const lvalue reference" "" { target c++23 } }
}

void g()
{
  S s;
  throw s; // { dg-error "cannot bind non-const lvalue reference" "" { target c++23 } }
}