OSDN Git Service

* call.c (add_candidates): Add first_arg and return_type parms.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.brendan / visibility3.C
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>'
6
7 class A {};
8
9 template <class TP>
10 class B;
11
12 template <class TP>
13 inline A &
14 operator<< (A &o, const B<TP> &m);
15
16 template <class TP>
17 class B
18 {
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);
24 };
25
26 template <class TP>
27 inline A &
28 operator<< (A &o, const B<TP> &m)
29 {
30   (*m._f) (o, m._a);
31   return o;
32 }
33
34 A &setw (A &, int);
35 B<int> setw (int n)
36 {
37   return B<int> (setw, n);
38 }
39
40 A x;
41
42 void f ()
43 {
44   x << setw (2);
45 }