aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access8.C
blob: c488ef76765ef40ad12ffa2d4c8d500aa4f5d514 (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
// { dg-do assemble  }
// From: smidt@dd.chalmers.se (Peter Smidt)
// Date: 25 Jan 1994 23:41:33 -0500
// Bug: g++ forgets access decls after the definition.

class inh { // { dg-error "" } inaccessible
        int a;
protected:
        void myf(int);
};

class mel : private inh {
protected:
        int t;
	inh::myf;  // { dg-warning "deprecated" }
};

class top_t : protected mel {
public:
        void myf(int);
};

void inh::myf(int i) {
        a = i;
}

void top_t::myf(int i) {
        inh::myf(i);		// { dg-error "" } cannot convert to inh
	mel::myf(i);
}