summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/overload3.C
blob: 49f9d69311f2ab2f6ba085ec1e8d5e985f9e3352 (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  }
// GROUPS passed overloading
typedef int rutBoolean;

class rutBigIntRep
{
public:
  friend rutBoolean operator>(const rutBigIntRep& a, const rutBigIntRep& b);
  operator rutBoolean() const;  
protected:
  enum Kluge {kluge};
  rutBigIntRep(Kluge) {}
  rutBigIntRep();
  rutBigIntRep(const rutBigIntRep& value);
  rutBigIntRep& operator=(const rutBigIntRep& value);
};

rutBoolean operator>(const rutBigIntRep& a, const rutBigIntRep& b) {
  // This should not result in a warning.  It used to warn about the
  // conversion from int to enum while exploring the possibility of
  // converting `a' via `operator rutBoolean', then using the
  // rutBigIntRep(Kluge) constructor.  It later realizes it shouldn't
  // do this, but the call to build_type_conversion was ending up with
  // a warning in convert.
  rutBigIntRep diff(a);
  return 0;
}