8sa1-gcc/gcc/testsuite/g++.old-deja/g++.law/visibility24.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

41 lines
589 B
C

// Build don't link:
// GROUPS passed visibility
// visibility file
// From: joe@consolve.com (Joe Shapiro)
// Date: Fri, 20 Aug 93 17:18:18 EDT
// Subject: Template classes seem to allow users to get at private members
// Message-ID: <9308202118.AA25599@ghana.consolve>
/*
* private.cc
*/
extern "C" void printf(...);
template <class T>
class A
{
public:
void Fun() { printf( "Fun fun fun!\n" ); } // ERROR - private
};
template <class T>
class B: private A<T>
{
};
class C
{
public:
C() { _b.Fun(); }// ERROR - .*
private:
B<int> _b;
};
main()
{
C c;
}