// { dg-do assemble } // Copyright (C) 1999 Free Software Foundation // by Alexandre Oliva template void foo(T); template void foo(T*); template class bar { private: int i; // { dg-error "" } this variable friend void foo(T); }; template void foo(T) { bar().i; // ok, I'm a friend } template void foo(T*) { bar().i; // { dg-error "" } not a friend } int main() { int j = 0; foo(j); // calls foo(int), ok foo(&j); // calls foo(int*) foo(&j); // calls foo(int*), ok }