| 1 |
// PR c++/78373 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
struct A { |
| 5 |
static A singleton; |
| 6 |
}; |
| 7 |
struct B { |
| 8 |
void m_fn2(); |
| 9 |
virtual int m_fn1(); |
| 10 |
}; |
| 11 |
struct D : B { |
| 12 |
static int m_fn3(int, int, int, A) { |
| 13 |
D &self = singleton; |
| 14 |
self.m_fn2(); |
| 15 |
return 0; |
| 16 |
} |
| 17 |
static D singleton; |
| 18 |
}; |
| 19 |
template <typename, typename> struct C { bool m_fn4() const; }; |
| 20 |
template <typename Base, typename Traits> bool C<Base, Traits>::m_fn4() const { |
| 21 |
Traits::m_fn3(0, 0, 0, Base::singleton); |
| 22 |
return true; |
| 23 |
} |
| 24 |
template struct C<A, D>; |