URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do compile }
|
// { dg-do compile }
|
|
|
// Copyright (C) 2004 Free Software Foundation
|
// Copyright (C) 2004 Free Software Foundation
|
// Contributed by Kriang Lerdsuwanakij
|
// Contributed by Kriang Lerdsuwanakij
|
|
|
// Nested class template of class template as friend
|
// Nested class template of class template as friend
|
|
|
template struct A
|
template struct A
|
{
|
{
|
template struct B
|
template struct B
|
{
|
{
|
void f();
|
void f();
|
};
|
};
|
};
|
};
|
|
|
template class C {
|
template class C {
|
int i;
|
int i;
|
template template friend struct A::B;
|
template template friend struct A::B;
|
};
|
};
|
|
|
template struct A
|
template struct A
|
{
|
{
|
template struct B
|
template struct B
|
{
|
{
|
void f();
|
void f();
|
};
|
};
|
};
|
};
|
|
|
template<> struct A
|
template<> struct A
|
{
|
{
|
template struct B
|
template struct B
|
{
|
{
|
void f();
|
void f();
|
};
|
};
|
};
|
};
|
|
|
template template void A::B::f()
|
template template void A::B::f()
|
{
|
{
|
C c;
|
C c;
|
c.i = 0;
|
c.i = 0;
|
}
|
}
|
|
|
template template void A::B::f()
|
template template void A::B::f()
|
{
|
{
|
C c;
|
C c;
|
c.i = 0;
|
c.i = 0;
|
}
|
}
|
|
|
template void A::B::f()
|
template void A::B::f()
|
{
|
{
|
C c;
|
C c;
|
c.i = 0;
|
c.i = 0;
|
}
|
}
|
|
|
template <> void A::B<'b'>::f()
|
template <> void A::B<'b'>::f()
|
{
|
{
|
C c;
|
C c;
|
c.i = 0;
|
c.i = 0;
|
}
|
}
|
|
|
int d2 = 0;
|
int d2 = 0;
|
|
|
int main()
|
int main()
|
{
|
{
|
A::B<0> b1;
|
A::B<0> b1;
|
b1.f();
|
b1.f();
|
A::B<&d2> b2;
|
A::B<&d2> b2;
|
b2.f();
|
b2.f();
|
A::B<'a'> b3;
|
A::B<'a'> b3;
|
b3.f();
|
b3.f();
|
A::B<'b'> b4;
|
A::B<'b'> b4;
|
b4.f();
|
b4.f();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.