summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/ref4.C
blob: 6b65d9925ab119e736ce2e93823b7edef2acfa2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { 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.
}