aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bugs/900213_03.C
blob: 4e15896b1c7c5bd1fde7a0f046f88fafefe812fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// g++ 1.36.1 bug 900213_03

// g++ fails to detect an error when the address of a "bound" function is
// assigned to a pointer-to-member-function variable.

// It does however correctly detect a similar errors for data-members.

// keywords: bound function, operator&, member pointers
// Build don't link: 

struct struct0 {
  int data_member;
  int function_member ();
};

int i;
int struct0::*dmp;
int (struct0::*fmp) ();

struct0 *ptr;

void global_function_0 ()
{
  fmp = &ptr->function_member;	// ERROR - 
  //dmp = &ptr->data_member;	//  caught by g++, missed by cfront
}

int main () { return 0; }