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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [memfriend3.C] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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