URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// PRMS Id: 6826
|
// PRMS Id: 6826
|
// Check that unnecessary templates are not instantiated.
|
// Check that unnecessary templates are not instantiated.
|
|
|
template
|
template
|
class Test
|
class Test
|
{
|
{
|
public:
|
public:
|
void doThiss();
|
void doThiss();
|
void doThat();
|
void doThat();
|
};
|
};
|
|
|
template
|
template
|
void Test::doThiss()
|
void Test::doThiss()
|
{
|
{
|
T x;
|
T x;
|
|
|
x.thiss();
|
x.thiss();
|
}
|
}
|
|
|
template
|
template
|
void Test::doThat()
|
void Test::doThat()
|
{
|
{
|
T x;
|
T x;
|
|
|
x.that();
|
x.that();
|
}
|
}
|
|
|
class A
|
class A
|
{
|
{
|
public:
|
public:
|
void thiss() {}
|
void thiss() {}
|
};
|
};
|
|
|
class B
|
class B
|
{
|
{
|
public:
|
public:
|
void that() {}
|
void that() {}
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
Test a;
|
Test a;
|
a.doThiss(); // a.doThat() is not well formed, but then
|
a.doThiss(); // a.doThat() is not well formed, but then
|
// it's not used so needn't be instantiated.
|
// it's not used so needn't be instantiated.
|
|
|
Test b;
|
Test b;
|
b.doThat(); // simillarly b.doThiss();
|
b.doThat(); // simillarly b.doThiss();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.