aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/overload3.C
blob: baa90fb282d547c7ce357a4b0d00408380204766 (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
// Build don't link: 
// 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;
}