Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.brendan/overload3.C

raw
1 // { dg-do assemble }
2 // GROUPS passed overloading
3 typedef int rutBoolean;
4
5 class rutBigIntRep
6 {
7 public:
8 friend rutBoolean operator>(const rutBigIntRep& a, const rutBigIntRep& b);
9 operator rutBoolean() const;
10 protected:
11 enum Kluge {kluge};
12 rutBigIntRep(Kluge) {}
13 rutBigIntRep();
14 rutBigIntRep(const rutBigIntRep& value);
15 rutBigIntRep& operator=(const rutBigIntRep& value);
16 };
17
18 rutBoolean operator>(const rutBigIntRep& a, const rutBigIntRep& b) {
19 // This should not result in a warning. It used to warn about the
20 // conversion from int to enum while exploring the possibility of
21 // converting `a' via `operator rutBoolean', then using the
22 // rutBigIntRep(Kluge) constructor. It later realizes it shouldn't
23 // do this, but the call to build_type_conversion was ending up with
24 // a warning in convert.
25 rutBigIntRep diff(a);
26 return 0;
27 }