summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/virtual2.C
blob: c93b89f44c01beeb0654dd72077881363b59311c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do run  }
struct B
{
  virtual int f() volatile
    { return 0; }
};


struct D : public B 
{
  virtual int f()
    { return 1; }
};

int main()
{
  volatile D d;
  volatile B& b = d;
  return b.f();
}