(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
init/
ref4.C
// { dg-do run }

int c;

struct Base {
  Base() {}
  Base(const Base &) { ++c; }
  Base & operator = (const Base &);
};

struct Derived : public Base {};

const Base &b = Derived();

int main()
{
  return c;  // No copies should be required.
}