summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/overload7.C
blob: c028d5ea1e446fc7735fe8b97812569c2c309339 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do run  }
// Check that object call works when there are multiple conversion ops
// returning the same type.

typedef int (*pfn)();

int zero () { return 0; }
int one  () { return 1; }
int two  () { return 2; }

struct A {
  A() { }
  operator pfn () { return one; }
  operator pfn () const { return zero; }
  operator pfn () volatile { return two; }
};

int
main ()
{
  const A a;
  return a();
}