2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / visibility20.C
blob0560523bfa482abb9214917295de29d6e2919263
1 // { dg-do assemble  }
2 // GROUPS passed visibility
3 // visibility file
4 // From: doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott)
5 // Date:     Tue, 10 Aug 93 10:06:33 PDT
6 // Subject:  G++ 2.4.5 allows access to protected base members
7 // Message-ID: <9308101706.AA04485@foxtrot.ccmrc.ucsb.edu>
9 class Base {
10 protected:
11       void protectedBaseFunction() {} // { dg-error "" } protected
12 public:
13     Base() {}
17 class Derived : public Base {
18 public:
19     Derived() {}
20     void noticeThisFunction(Base *);
24 void
25 Derived::noticeThisFunction(Base *b) {
26     b->protectedBaseFunction(); // ARM says this is not allowed// { dg-error "" } .*
27                                 // since it is not called on 'this'
30 int main() {
31     Base b;
32     Derived d;
33     d.noticeThisFunction(&b);
34     printf("gpptest run\n");// { dg-error "" } .*