OSDN Git Service

Initial revision
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.jason / overload23.C
1 // From: panisset@cae.ca (Jean-Francois Panisset)
2 // Date: Mon, 6 Jun 94 13:39:25 EDT
3 // Subject: Problem with operator overloading
4
5 // Build don't link:
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 main()
23 {
24   X x;
25   ostream os;
26   os << x; // gets bogus error - converting to float
27 }