xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/g++.old-deja/g++.other/conv2.C (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 // Build don't link:
2 // Special g++ Options: -pedantic-errors
3 
cheat(int * i)4 void cheat( int* i ) { ++(*i); }
5 
6 struct t {
cheatt7         void cheat( int& i ) { ++i; }
8 };
9 
main()10 int main()
11 {
12   void (t::*member)( const int& ) = &t::cheat; // ERROR - conversion
13   void (*cheater)( const int* ) = &cheat; // ERROR - converting
14   t t2;
15   const int i=1;
16   int j=1;
17   (t2.*member)( i );
18   (t2.*member)( j );
19 }
20