summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/overload23.C
blob: fe605f03799b83d4df9c6dd5651eb692a9b79fbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// { dg-do assemble  }
// From: panisset@cae.ca (Jean-Francois Panisset)
// Date: Mon, 6 Jun 94 13:39:25 EDT
// Subject: Problem with operator overloading


class ostream {
public:
  ostream& operator<<(double n);
  ostream& operator<<(float n);
};

class X
{
public:
  operator long() const;
  operator double() const;
};
ostream& operator<< (ostream& os, const X& x);


int main()
{
  X x;
  ostream os;
  os << x; // { dg-bogus "" } converting to float
}