2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / visibility3.C
blob249ae8116ea9465476bf2807cef4e73fae250d90
1 // { dg-do assemble  }
2 // GROUPS passed visibility
3 // Used to say:
4 // manip.cc:17: member `_f' is a private member of class `B<int>'
5 // manip.cc:17: member `_a' is a private member of class `B<int>'
7 class A {};
9 template <class TP>
10 class B;
12 template <class TP>
13 inline A &
14 operator<< (A &o, const B<TP> &m);
16 template <class TP>
17 class B
19   A &(*_f) (A &, TP);
20   TP _a;
21 public:
22   B (A &(*f) (A &, TP), TP a) : _f (f), _a (a) {}
23   friend A &operator<< <>(A &o, const B<TP> &m);
26 template <class TP>
27 inline A &
28 operator<< (A &o, const B<TP> &m)
30   (*m._f) (o, m._a);
31   return o;
34 A &setw (A &, int);
35 B<int> setw (int n)
37   return B<int> (setw, n);
40 A x;
42 void f ()
44   x << setw (2);