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 run }
|
// { dg-do run }
|
// Testcase for use of template parms as types for other template parms.
|
// Testcase for use of template parms as types for other template parms.
|
|
|
template
|
template
|
class A {
|
class A {
|
T a;
|
T a;
|
public:
|
public:
|
A(): a(t) {}
|
A(): a(t) {}
|
|
|
operator T () { return a; }
|
operator T () { return a; }
|
};
|
};
|
|
|
template
|
template
|
class B {
|
class B {
|
A a;
|
A a;
|
public:
|
public:
|
B(A& b): a(b) {}
|
B(A& b): a(b) {}
|
|
|
operator S () { return a*20; }
|
operator S () { return a*20; }
|
};
|
};
|
|
|
int
|
int
|
main()
|
main()
|
{
|
{
|
A a;
|
A a;
|
B b(a);
|
B b(a);
|
|
|
if (b * a == 500)
|
if (b * a == 500)
|
return 0;
|
return 0;
|
else
|
else
|
return 1;
|
return 1;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.