summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/template24.C
blob: 0efce9ff12ec166b0ad993cf297a232388208b63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do run  }
// Bug: g++ doesn't find the conversion from ostream_withassign to ostream.

#include <iostream>

template <class T>
struct A {
  T t;
};

template <class T>
std::ostream & operator<< (std::ostream & os, A<T> & a)
{
  os << a.t;
  return os;
}

int main ()
{
  A<int> a = { 1 };
  std::cout << a << std::endl;
}