| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-w -O2" } */ |
| 3 |
|
| 4 |
struct A { |
| 5 |
int operator[](int) const {} |
| 6 |
}; |
| 7 |
struct B { |
| 8 |
void m_fn1(); |
| 9 |
}; |
| 10 |
struct C { |
| 11 |
virtual bool m_fn2(int, unsigned &, A &, int &, unsigned long &, bool); |
| 12 |
}; |
| 13 |
template <class MCAsmParserImpl> struct D { |
| 14 |
D(int) { MCAsmParserImpl(0, 0, 0, 0); } |
| 15 |
}; |
| 16 |
int a; |
| 17 |
namespace { |
| 18 |
struct F : C { |
| 19 |
bool m_fn2(int, unsigned &, A &, int &, unsigned long &, bool); |
| 20 |
unsigned m_fn3(const A &, B &); |
| 21 |
F(int, int, int, int) {} |
| 22 |
}; |
| 23 |
} |
| 24 |
bool F::m_fn2(int, unsigned &, A &p3, int &, unsigned long &, bool) { |
| 25 |
B b; |
| 26 |
m_fn3(p3, b); |
| 27 |
} |
| 28 |
void fn1() { D<F>(0); } |
| 29 |
unsigned F::m_fn3(const A &p1, B &p2) { |
| 30 |
for (int *p;; p++) |
| 31 |
switch (*p) { |
| 32 |
case 0: |
| 33 |
p1[a]; |
| 34 |
case 1: |
| 35 |
p2.m_fn1(); |
| 36 |
} |
| 37 |
} |
| 38 |
|