| 1 |
// { dg-do assemble } |
| 2 |
// From: [email protected] (Jean-Francois Panisset) |
| 3 |
// Date: Mon, 6 Jun 94 13:39:25 EDT |
| 4 |
// Subject: Problem with operator overloading |
| 5 |
|
| 6 |
|
| 7 |
class ostream { |
| 8 |
public: |
| 9 |
ostream& operator<<(double n); |
| 10 |
ostream& operator<<(float n); |
| 11 |
}; |
| 12 |
|
| 13 |
class X |
| 14 |
{ |
| 15 |
public: |
| 16 |
operator long() const; |
| 17 |
operator double() const; |
| 18 |
}; |
| 19 |
ostream& operator<< (ostream& os, const X& x); |
| 20 |
|
| 21 |
|
| 22 |
int main() |
| 23 |
{ |
| 24 |
X x; |
| 25 |
ostream os; |
| 26 |
os << x; // { dg-bogus "" } converting to float |
| 27 |
} |