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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [friend44.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do compile }
2
// Test that template friends referring to class template members are
3
// respected.
4
 
5
 
6
template  struct A
7
{
8
  int f (T);
9
  struct AI {
10
    int f (T);
11
  };
12
};
13
 
14
class B
15
{
16
  template  friend int A::f (T);
17
  template  friend struct A::AI;
18
  int a;
19
public:
20
  B(): a(0) { }
21
};
22
 
23
template  int A::f (T)
24
{
25
  B b;
26
  return b.a;
27
}
28
 
29
template  int A::AI::f (T)
30
{
31
  B b;
32
  return b.a;
33
}
34
 
35
int main ()
36
{
37
  A a;
38
  A::AI ai;
39
 
40
  int r = a.f (0);
41
  r |= ai.f (0);
42
 
43
  return r;
44
}

powered by: WebSVN 2.1.0

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