URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Subversion Repositories scarts
[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [visibility16.C] - Rev 12
Compare with Previous | Blame | View Log
// { dg-do assemble }
// GROUPS passed visibility
// visibility file
// From: Marie Trapp <Marie.Trapp@analog.com>
// Date: Thu, 5 Aug 93 11:55:15 EDT
// Subject: access of protected members
// Message-ID: <9308051553.AA07639@nwd2sun1.analog.com>
class A {
protected:
int astuff; // { dg-error "" } protected
A() {
astuff = 3;
}
};
class B : public A {
int bstuff;
public:
B( A *p) {
bstuff = p->astuff;// { dg-error "" } .*
}
};
class C : public A {
int cstuff;
public:
C() {
cstuff = 5;
}
};
int main() {
C cvar;
B bvar(&cvar);
}