summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/vbase1.C
blob: 4cfe51d7740f8840ba5ad1d6ead4f8915e2da4d9 (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
// { dg-do assemble  }
// GROUPS passed vbase
// vbase file
// From: pino@hubble.eecs.berkeley.edu (Jose Luis Pino)
// Date:     28 Jul 1994 05:17:39 GMT
// Subject:  g++ 2.6 bug: virtual base class & protected methods
// Message-ID: <317f1j$o9c@agate.berkeley.edu>


#include <iostream>

class a {
protected:
	virtual void foo() { std::cout << "Class A\n";}
};

class b : public virtual a {};

class c : public b {
public:
	void bar() { b::foo();}
};

int main() {
	c test;
	test.bar();
}