aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/conv2.C
blob: e713304c575668d6aab7eefdc4467c4b3b9ca47e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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 );
}