OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb44.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
// spurious 'const' in error.
3
// For egcs-2.91.34, the warning message refers to
4
// class ostream & operator <<(class ostream &, const class Vector &)
5
// Also, the template instantiation does not provide the missing
6
// friend function, the non-template function does
7
 
8
#include 
9
#include 
10
#include 
11
 
12
using namespace std;
13
 
14
template 
15
class Vector
16
{
17
  friend ostream& operator<< (ostream& out, const Vector & vec); // { dg-warning "" }
18
};
19
 
20
template 
21
ostream& operator<< (ostream& out,  const Vector & vec)
22
{
23
  abort();  // this should not be called
24
}
25
 
26
template class Vector;
27
template ostream& operator<< (ostream& out,  const Vector &);
28
 
29
ostream& operator<< (ostream& out, const Vector&)
30
{
31
  return out;
32
}
33
 
34
int main()
35
{
36
  Vector vc;
37
  cout << vc;
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.