| 1 |
// { dg-do run } |
| 2 |
// Bug: g++ screws up derived->base conversions when calling a global function |
| 3 |
// in the presence of matching members in the base. Whew. |
| 4 |
|
| 5 |
struct xios { |
| 6 |
virtual ~xios() { } |
| 7 |
}; |
| 8 |
|
| 9 |
struct xistream: virtual public xios { |
| 10 |
int j; |
| 11 |
void operator>>(char&); |
| 12 |
}; |
| 13 |
|
| 14 |
struct xfstreambase: virtual public xios { }; |
| 15 |
|
| 16 |
struct xifstream: public xfstreambase, public xistream { }; |
| 17 |
|
| 18 |
void operator>>(xistream& i, int j) |
| 19 |
{ |
| 20 |
i.j = 0; |
| 21 |
} |
| 22 |
|
| 23 |
int main() { |
| 24 |
int i; |
| 25 |
xifstream ifs; |
| 26 |
|
| 27 |
ifs >> i; |
| 28 |
} |