Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.jason/overload9.C

raw
1 // { dg-do assemble }
2 // PRMS Id: 4257
3 // Bug: g++ ignores non-member possibilities (ideal_candidate_ansi bug)
4
5 class ostream
6 {
7 public:
8 #ifdef EITHER_ONE_A
9 ostream& operator<<(unsigned long n);
10 ostream& operator<<(long n);
11 #else
12 ostream& operator<<(short n);
13 ostream& operator<<(unsigned short n);
14 #endif
15 };
16
17 class ccObjectInfo {};
18
19 ostream& operator << (ostream& out, const ccObjectInfo& obj);
20
21 class ccString : public ccObjectInfo
22 {
23 #ifdef EITHER_ONE_B
24 operator int () const;
25 #else
26 operator long () const;
27 #endif
28 };
29
30 // Should pick this one!!
31 ostream& operator << (ostream& o, const ccString & s);
32
33 extern ostream cout;
34
35 void f ()
36 {
37 ccString foo;
38 cout << foo;
39 }