OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [visibility3.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed visibility
3
// Used to say:
4
// manip.cc:17: member `_f' is a private member of class `B'
5
// manip.cc:17: member `_a' is a private member of class `B'
6
 
7
class A {};
8
 
9
template 
10
class B;
11
 
12
template 
13
inline A &
14
operator<< (A &o, const B &m);
15
 
16
template 
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 &m);
24
};
25
 
26
template 
27
inline A &
28
operator<< (A &o, const B &m)
29
{
30
  (*m._f) (o, m._a);
31
  return o;
32
}
33
 
34
A &setw (A &, int);
35
B setw (int n)
36
{
37
  return B (setw, n);
38
}
39
 
40
A x;
41
 
42
void f ()
43
{
44
  x << setw (2);
45
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.