8sa1-gcc/gcc/testsuite/g++.old-deja/g++.other/conv2.C
Mark Mitchell f4c81730d8 New test
From-SVN: r19277
1998-04-18 01:12:22 +00:00

20 lines
377 B
C

// Build don't link:
// Special g++ Options: -pedantic-errors
void cheat( int* i ) { ++(*i); }
struct t {
void cheat( int& i ) { ++i; }
};
int main()
{
void (t::*member)( const int& ) = &t::cheat; // ERROR - conversion
void (*cheater)( const int* ) = &cheat; // ERROR - converting
t t2;
const int i=1;
int j=1;
(t2.*member)( i );
(t2.*member)( j );
}