aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bugs/900213_01.C
blob: 309a41943dab5d75d8802014a5de2c3be3041984 (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
// g++ 1.36.1 bug 900213_01

// g++ incorrectly diagnoses the error when an attempt is made to reference
// a non-static data-member without an object indication.

// Similar attempts to reference non-static function-members are correctly
// diagnosed by g++.

// Cfront 2.0 passes this test.

// keywords: non-static members, member pointers, scope resolution

struct struct0 {
  int struct0_data_member_0;		/* ERROR - gets error from below */
  int struct0_function_member_0 ();
};

int i;

void global_function_0 ()
{
  i = struct0::struct0_data_member_0;		/* ERROR - mishandled by g++ */
  //i = struct0::struct0_function_member_0 ();	/* gets caught by g++ */
}

int main () { return 0; }