summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/visibility7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/visibility7.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility7.C71
1 files changed, 0 insertions, 71 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility7.C b/gcc/testsuite/g++.old-deja/g++.law/visibility7.C
deleted file mode 100644
index 764da35d9db..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility7.C
+++ /dev/null
@@ -1,71 +0,0 @@
-// Build don't link:
-// GROUPS passed visibility
-// visibility file
-// From: Gordon Joly <G.Joly@cs.ucl.ac.uk>
-// Date: Wed, 21 Apr 93 09:42:07 +0100
-// Subject: /*** BUG REPORT : THE MYTH OF PRIVATE INHERITANCE ***/
-// Message-ID: <9304210842.AA01815@life.ai.mit.edu>
-#include <iostream.h>
-
-class A {
- private:
- int number;
- public:
- A(int i) : number(i)
- {}
- virtual ~A()
- {}
- virtual void Number(int c)
- { number = c; } // ERROR - private
- virtual int Number()
- { return number; } // ERROR - private
-};
-
-class B : private A {
- private:
- int second_number;
- public:
- B(int c, int i) : second_number(c), A(i)
- {}
- virtual ~B()
- {}
-
- virtual void firstNumber(int b) // renames member function Number(int) of class A
- { A::Number(b); }
- virtual int firstNumber() // renames member function Number() of class A
- { return A::Number(); }
-};
-
-
-
-
-class C {
- private:
- B* bobject;
- public:
- C(B* bp) : bobject(bp)
- {}
- virtual ~C()
- {}
- //
- // the following two functions access
- // private member functions of class B
- // and they should not be able to do so
- //
- virtual void setBValue(int i)
- { if (bobject) bobject->Number(i); }// ERROR - .*
- virtual int getBValue()
- { if (bobject) { return bobject->Number(); } return 0; }// ERROR - .*
-};
-
-
-int main()
-{
- B* bobject = new B(2, 1);
- C* cobject = new C(bobject);
- cobject->setBValue(8);
- cout << cobject->getBValue() << endl;
- delete bobject;
- delete cobject;
-}
-