| 1 |
// { dg-do run } |
| 2 |
template <class T> |
| 3 |
void f(T); |
| 4 |
|
| 5 |
template <class U> |
| 6 |
class C |
| 7 |
{ |
| 8 |
template <class T> |
| 9 |
friend void f(T) |
| 10 |
{ |
| 11 |
C<U> c; |
| 12 |
c.i = 3; |
| 13 |
} |
| 14 |
|
| 15 |
public: |
| 16 |
|
| 17 |
void g() |
| 18 |
{ |
| 19 |
f(3.0); |
| 20 |
} |
| 21 |
|
| 22 |
int i; |
| 23 |
}; |
| 24 |
|
| 25 |
int main() |
| 26 |
{ |
| 27 |
f(7); |
| 28 |
C<double> c; |
| 29 |
c.g(); |
| 30 |
} |