aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C
blob: 8161b59b801a22a7cebe25c3990134f8543c9059 (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
29
30
31
32
33
34
35
// g++ 1.37.1 bug 900519_13

// If multiple inheritance creates a situation in which a given name is
// inherited from more than one base class, and if the inherited declarations
// for the name are for different categories of members (e.g. object members,
// function members, enumeral members), then g++ will (in some cases) fail
// to flag errors when the ambiguous name is used.

// cfront 2.0 passes this test.

// keywords: inheritance, ambiguity resolution, members

struct base_0 {
  enum { base_member };
};

struct base_1 {
  int base_member;
};

struct base_2 {
  int base_member ();
};

struct derived_0 : public base_0, public base_1 {
  void member () { base_member; }			// ERROR - 
};

struct derived_1 : public base_0, public base_2 {
  void member () { base_member; }			// ERROR - missed
};

struct derived_2 : public base_1, public base_2 {
  void member () { base_member; }			// ERROR - missed
};