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