Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.old-deja / g++.robertl / eb44.C
blob314ec9d2426638f07e00b2e897f4382403370f9f
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 "" } 
20 template <class T>
21 ostream& operator<< (ostream& out,  const Vector<T> & vec)
23   abort();  // this should not be called
26 template class Vector<char>;
27 template ostream& operator<< (ostream& out,  const Vector<char> &);
29 ostream& operator<< (ostream& out, const Vector<char>&)
31   return out;
34 int main()
36   Vector<char> vc;
37   cout << vc;