URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [friend11.C] - Rev 154
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do assemble }
template <class T>
class C;
template <class T>
struct S
{
template <class U>
void f(U u)
{
C<U> cu;
cu.i = 3; // { dg-error "" } S<double>::f<U> is a friend, but this is
// S<int>::f<double>.
}
};
template <class T>
class C
{
template <class U>
friend void S<T>::f(U);
int i; // { dg-error "" } private
};
int main()
{
S<int> si;
si.f(3.0);
}
Go to most recent revision | Compare with Previous | Blame | View Log