repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
template
/
friend4.C
blob
fabf3375bd2152c1039441809bbf775baceffee6
1
// { dg-do compile }
2
3
// Copyright (C) 2002 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 18 Dec 2001 <nathan@codesourcery.com>
5
6
// PR 109, dependent member friends
7
8
struct B
9
{
10
static int foo ();
11
struct N
12
{
13
static int bar ();
14
};
15
};
16
17
18
template <class T>
19
class A
20
{
21
friend int T::foo ();
22
friend int T::N::bar ();
23
24
private:
25
static int m;
26
};
27
28
template <class T>
29
class C
30
{
31
friend struct T::N;
32
33
private:
34
static int m;
35
};
36
37
38
int B::foo ()
39
{
40
return A<B>::m;
41
}
42
43
int B::N::bar ()
44
{
45
return A<B>::m + C<B>::m;
46
}