diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/arm12.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/arm12.C | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm12.C b/gcc/testsuite/g++.old-deja/g++.law/arm12.C new file mode 100644 index 00000000000..89e2a4d2c82 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.law/arm12.C @@ -0,0 +1,47 @@ +// Build don't link: +// GROUPS passed ARM-compliance +// arm file +// From: belley@cae.ca (Benoit Belley 3218) +// Subject: Bad access control with private constructor and derivation +// Date: Fri, 28 May 1993 12:39:57 -0400 (EDT) + +#include <iostream.h> + +class X +{ +public: + void f(); + +private: + X(); +}; + +class Y : public X +{ +public: + Y(); +}; + +X::X() +{// ERROR - .* + cout << "X::X()" << endl; +} + +void X::f() +{ + cout << "X::f()" << endl; +} + +Y::Y() +{// ERROR - within this + cout << "Y::Y()" << endl; +} + + +int main() +{ + Y y; + y.f(); +} + + |