| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -c -w" } */ |
| 3 |
|
| 4 |
template <class> class A; |
| 5 |
template <class R> struct VirtualMatrice { |
| 6 |
virtual bool m_fn1(int) const { return true; } |
| 7 |
struct B { |
| 8 |
A<R> x; |
| 9 |
B(VirtualMatrice *p1, A<R> p2) : x(p2) { p1->m_fn1(0) ?: throw; } |
| 10 |
}; |
| 11 |
void operator*(A<R> p1) { B(this, p1); } |
| 12 |
~VirtualMatrice(); |
| 13 |
} |
| 14 |
; |
| 15 |
template <class> class A { |
| 16 |
public: |
| 17 |
operator int *(); |
| 18 |
A(int *, long); |
| 19 |
}; |
| 20 |
|
| 21 |
class G : public A<int> { |
| 22 |
public: |
| 23 |
G(long); |
| 24 |
}; |
| 25 |
int typedef Complex; |
| 26 |
template <class> class H : VirtualMatrice<int> {}; |
| 27 |
template <class> class C; |
| 28 |
template <> class C<int> : H<Complex>, VirtualMatrice<Complex> { |
| 29 |
bool m_fn1(int) const { return true; } |
| 30 |
}; |
| 31 |
template <class K, class Mat> |
| 32 |
void DoIdoAction(int, int, A<K> p3, A<K>, A<K>, A<K>, Mat, Mat &p8) { |
| 33 |
p8 *p3; |
| 34 |
} |
| 35 |
|
| 36 |
class D { |
| 37 |
typedef int K; |
| 38 |
class F { |
| 39 |
int operator()() const; |
| 40 |
}; |
| 41 |
}; |
| 42 |
int D::F::operator()() const { |
| 43 |
VirtualMatrice<K> *a; |
| 44 |
VirtualMatrice<K> b, &B = *a; |
| 45 |
G c(0), g(1); |
| 46 |
int d, e, f; |
| 47 |
A<K> h(&g[f], 0), i(&g[e], 0), j(&g[d], 0); |
| 48 |
DoIdoAction(0, 3, h, i, j, c, b, B); |
| 49 |
} |