summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/ref3.C
blob: 3a5853c231887426475b95969a6fe3f83999ab05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// { dg-do run  }
// Origin: Mark Mitchell <mark@codesourcery.com>

struct B1
{
  int i;
};

struct B2
{
  int j;
};

struct D: public B1, B2 
{
};

bool f (B2& b)
{
  return b.j == 7;
}

int main ()
{
  D d;
  d.i = 2;
  d.j = 7;
  if (!f (d))
    return 1;
}