diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/visibility9.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/visibility9.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility9.C b/gcc/testsuite/g++.old-deja/g++.law/visibility9.C new file mode 100644 index 00000000000..df98640c90d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility9.C @@ -0,0 +1,22 @@ +// Build don't link: +// GROUPS passed visibility +// visibility file +// rom: roland@jts.com (Roland Knight ) +// Date: Sat, 8 May 1993 17:27:35 -0400 +// Subject: gcc 2.3.3 protected member access bug +// Message-ID: <9305082127.AA19577@icepick.jts.com> + +class A { +protected: + int a; +}; + +class B : public A { +public: + void f1(A* pa); +}; + + +void B::f1(A* pa) { + pa->a = 1; // illegal but allowed by gcc// ERROR - .* +} |