3 // Copyright (C) 1999 Free Software Foundation
5 // by Alexandre Oliva <oliva@dcc.unicamp.br>
7 template <typename T> void foo(T);
8 template <typename T> void foo(T*);
10 template <typename T> class bar {
12 int i; // { dg-error "" } this variable
13 friend void foo<T>(T);
16 template <typename T> void foo(T) {
17 bar<T>().i = 0; // ok, I'm a friend
19 template <typename T> void foo(T*) {
20 bar<T*>().i = 1; // { dg-error "" } not a friend
25 foo(j); // calls foo<int>(int), ok
26 foo(&j); // calls foo<int>(int*)
27 foo<int*>(&j); // calls foo<int*>(int*), ok