]>
Commit | Line | Data |
---|---|---|
138928a6 JM |
1 | // Build don't link: |
2 | ||
3 | template <class T> | |
4 | void f(T); | |
5 | ||
6 | class C | |
7 | { | |
8 | friend void f<>(double); | |
9 | ||
d6479fe7 | 10 | int i; // ERROR - private |
138928a6 JM |
11 | }; |
12 | ||
13 | ||
14 | template <class T> | |
15 | void f(T) | |
16 | { | |
17 | C c; | |
18 | c.i = 3; // ERROR - f<double> is a friend, this is f<int>. | |
19 | } | |
20 | ||
21 | ||
22 | int main() | |
23 | { | |
24 | f(7); | |
25 | } |