2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / conv2.C
blob56e41039e0a9b75f3edd29d532eba0ed17bc798a
1 // { dg-do assemble  }
2 // { dg-options "-pedantic-errors" }
4 void cheat( int* i ) { ++(*i); }
5  
6 struct t {
7         void cheat( int& i ) { ++i; }
8 };
10 int main()
12   void (t::*member)( const int& ) = &t::cheat; // { dg-error "" } conversion
13   void (*cheater)( const int* ) = &cheat; // { dg-error "" } converting
14   t t2;
15   const int i=1;
16   int j=1;
17   (t2.*member)( i );
18   (t2.*member)( j );