Rebase.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb44.C
bloba7e61804cb1a3c504a5dc9851a8f18e888c8ec87
1 // { 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<T> &)
5 // Also, the template instantiation does not provide the missing
6 // friend function, the non-template function does
8 #include <cstdio>
9 #include <cstdlib>
10 #include <iostream>
12 using namespace std;
14 template <class T>
15 class Vector
17   friend ostream& operator<< (ostream& out, const Vector<T> & vec); // { dg-warning "non-template" "warn" } 
18   // { dg-message "note" "note" { target *-*-* } 17 }
21 template <class T>
22 ostream& operator<< (ostream& out,  const Vector<T> & vec)
24   abort();  // this should not be called
27 template class Vector<char>;
28 template ostream& operator<< (ostream& out,  const Vector<char> &);
30 ostream& operator<< (ostream& out, const Vector<char>&)
32   return out;
35 int main()
37   Vector<char> vc;
38   cout << vc;