[gnu.g++.bug] function types

rokicki@Neon.Stanford.EDU (Tomas G. Rokicki) (01/19/90)

The following code:

typedef int *(evalftype)(int, int) ;

class foo {
   int t ;
   evalftype *f ;
public:
   foo(int a) { t = a ; f = 0 ; }
   foo(evalftype *b) { t = 0 ; f = b ; }
} ;

int *bar(int a, int b) {
   int *p = new int ;
   *p = a - b ;
   return p ;
}

foo *baz() {
   return new foo(&bar) ;
}

(which compiles under cfront 1.2) gives me the errors:

bump.cp: In function class foo *baz():
bum.cp:18: type for resolving address of overloaded function must be pointer type
bum.cp:18: bad argument 0 for function `foo::foo (auto int *(*)(int ,int ))' (type was int *(*)(int ,int ))
bum.cp:18: in base initialization for class 'foo'

I'm running 1.36.1 (but am bringing up 1.36.3 . . .)

-tom