URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do assemble }
|
// { dg-do assemble }
|
// spurious 'const' in error.
|
// spurious 'const' in error.
|
// For egcs-2.91.34, the warning message refers to
|
// For egcs-2.91.34, the warning message refers to
|
// class ostream & operator <<(class ostream &, const class Vector &)
|
// class ostream & operator <<(class ostream &, const class Vector &)
|
// Also, the template instantiation does not provide the missing
|
// Also, the template instantiation does not provide the missing
|
// friend function, the non-template function does
|
// friend function, the non-template function does
|
|
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
|
|
using namespace std;
|
using namespace std;
|
|
|
template
|
template
|
class Vector
|
class Vector
|
{
|
{
|
friend ostream& operator<< (ostream& out, const Vector & vec); // { dg-warning "" }
|
friend ostream& operator<< (ostream& out, const Vector & vec); // { dg-warning "" }
|
};
|
};
|
|
|
template
|
template
|
ostream& operator<< (ostream& out, const Vector & vec)
|
ostream& operator<< (ostream& out, const Vector & vec)
|
{
|
{
|
abort(); // this should not be called
|
abort(); // this should not be called
|
}
|
}
|
|
|
template class Vector;
|
template class Vector;
|
template ostream& operator<< (ostream& out, const Vector &);
|
template ostream& operator<< (ostream& out, const Vector &);
|
|
|
ostream& operator<< (ostream& out, const Vector&)
|
ostream& operator<< (ostream& out, const Vector&)
|
{
|
{
|
return out;
|
return out;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
Vector vc;
|
Vector vc;
|
cout << vc;
|
cout << vc;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.