summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C
blob: 0a8a6cc378c0b5b09377130cf6ed4d46824d673b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Bug: g++ fails to instantiate operator<<.
// Build don't run:
// Special g++ Options: -g

struct ostream {
  ostream& operator<< (const char *) { return *this; };
};

template <class T> class foo;

template <class T> ostream& operator<< (ostream& ios, foo<T>&obj) { };

template <class T> class foo {
  friend ostream& operator<<<>(ostream&, foo<T>&);
};

int main()
{
  ostream cout;
  foo<int> foo_obj;
  cout << foo_obj; // causes linker error
  return 0;
}