8sa1-gcc/gcc/testsuite/g++.old-deja/g++.other/ptrmem2.C
Mark Mitchell 9ca21c0adb typeck.c (build_ptrmemfunc): Typecheck pointer-to-member conversions.
* typeck.c (build_ptrmemfunc): Typecheck pointer-to-member
	conversions.

From-SVN: r17874
1998-02-12 14:51:57 +00:00

16 lines
363 B
C

class cow {
public:
void moo (char *);
};
void f()
{
cow* c;
void (cow::*fp0)(char*) = &cow::moo; // OK
void (cow::*fp1)(int) = &cow::moo; // ERROR - conversion
int (cow::*fp2)(char*) = &cow::moo; // ERROR - conversion
int (cow::*fp3)(char*, void*) = fp2; // ERROR - conversion
int (cow::*fp4)(double) = (int (cow::*)(double)) fp2; // OK
}