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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [friend6.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
namespace boost_no_member_template_friends{
4
 
5
template 
6
class foobar;
7
 
8
template 
9
class foo
10
{
11
private:
12
   template friend class foobar;
13
   template friend class foo;
14
   template friend bool must_be_friend_proc(const foo& f);
15
   int i;
16
public:
17
   foo(){ i = 0; }
18
   template 
19
   foo(const foo& f){ i = f.i; }
20
};
21
 
22
template 
23
class foo;
24
 
25
template 
26
bool must_be_friend_proc(const foo& f);
27
 
28
template 
29
bool must_be_friend_proc(const foo& f)
30
{ return f.i != 0; }
31
 
32
template 
33
class foobar
34
{
35
   int i;
36
public:
37
   template 
38
   foobar(const foo& f)
39
   { i = f.i; }
40
};
41
 
42
 
43
int test()
44
{
45
   foo fi;
46
   foo fd(fi);
47
   (void) &fd;           // avoid "unused variable" warning
48
   foobar fb(fi);
49
   (void) &fb;           // avoid "unused variable" warning
50
   return 0;
51
}
52
 
53
}

powered by: WebSVN 2.1.0

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