1 // { dg-do compile }
2 
3 class A {
4       virtual unsigned long m_fn1() const;
5         virtual int &m_fn2(unsigned long) const;
6 };
7 class C : A {
8 public:
9       int &m_fn2(unsigned long) const;
10         unsigned long m_fn1() const;
11 };
12 class B {
13       void m_fn3(const A &, const int &, const C &, int &) const;
14 };
m_fn3(const A &,const int &,const C &,int &)15 void B::m_fn3(const A &, const int &, const C &, int &) const {
16       C &a(a);
17         for (long b = 0; a.m_fn1(); b++)
18 	      a.m_fn2(0);
19 }
20