OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [template/] [memfriend2.C] - Blame information for rev 301

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2003 Free Software Foundation
4
// Contributed by Kriang Lerdsuwanakij 
5
 
6
// Member function template of class template as friend
7
 
8
template  struct A
9
{
10
  template  void f();
11
};
12
 
13
class C {
14
  int i;
15
  template  template  friend void A::f();
16
};
17
 
18
template  struct A
19
{
20
  template  void f();
21
};
22
 
23
template <> struct A
24
{
25
  template  void f();
26
};
27
 
28
template  template  void A::f()
29
{
30
  C c;
31
  c.i = 0;
32
}
33
 
34
template  template  void A::f()
35
{
36
  C c;
37
  c.i = 0;
38
}
39
 
40
template  void A::f()
41
{
42
  C c;
43
  c.i = 0;
44
}
45
 
46
template <> void A::f()
47
{
48
  C c;
49
  c.i = 0;
50
}
51
 
52
int main()
53
{
54
  A a1;
55
  a1.f();
56
  A a2;
57
  a2.f();
58
  A a3;
59
  a3.f();
60
  a3.f();
61
}

powered by: WebSVN 2.1.0

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