repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Daily bump.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
friend11.C
blob
1aeba3a1018a9dfc72f7989038dac632b7f0bfca
1
template <class T>
2
class C;
3
4
template <class T>
5
struct S
6
{
7
template <class U>
8
void f(U u)
9
{
10
C<U> cu;
11
cu.i = 3; // ERROR - S<double>::f<U> is a friend, but this is
12
// S<int>::f<double>.
13
}
14
};
15
16
17
template <class T>
18
class C
19
{
20
template <class U>
21
friend void S<T>::f(U);
22
23
int i; // ERROR - private
24
};
25
26
27
int main()
28
{
29
S<int> si;
30
si.f(3.0);
31
}