summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/visibility24.C
blob: 3acd837079526b009fa0a5cdbad02e2091227dac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// { dg-do assemble  }
// 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" int printf (const char *, ...);

template <class T>
class A
{
public:
      void Fun() { printf( "Fun fun fun!\n" ); } // { dg-error "" } private
};


template <class T>
class B: private A<T>
{
};


class C
{
public:
    C() { _b.Fun(); }// { dg-error "" } .*

private:
    B<int> _b;
};


int main()
{
    C c;
}