summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr59510.C
blob: dcdf860dcf7309f937113508e898ddb21ce85b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// PR debug/59510
// { dg-do compile }
// { dg-options "-O2 -g --param=large-stack-frame-growth=1" }

template <typename _Iterator>
struct _Iter_base
{
  typedef _Iterator iterator_type;
};
template <typename _CharT>
struct basic_ostream;
template <typename _CharT>
struct basic_ostringstream;
template <typename _CharT>
struct ostreambuf_iterator;
typedef basic_ostringstream <char>ostringstream;
template <typename _Iterator> struct _Miter_base : _Iter_base <_Iterator>
{
};
template <typename _Iterator>
typename _Miter_base <_Iterator>::iterator_type __miter_base (_Iterator);
template <typename _CharT>
ostreambuf_iterator <_CharT>
__copy_move_a2 (ostreambuf_iterator <_CharT>);
template <typename _II, typename _OI>
_OI copy (_II __first, _II __last, _OI __result)
{
  __copy_move_a2 <false> (__first, __miter_base (__last), __result);
}
struct ios_base {
  struct _Words {
    int *_M_pword;
    long _M_iword;
  };
  _Words _M_local_word[8];
};
template <typename _CharT>
struct basic_streambuf
{
  typedef _CharT char_type;
  int sputn (char_type *, int);
};
template <typename _CharT>
struct ostreambuf_iterator
{
  typedef basic_streambuf <_CharT> streambuf_type;
  typedef basic_ostream <_CharT> ostream_type;
  streambuf_type *_M_sbuf;
  bool _M_failed;
  ostreambuf_iterator (ostream_type __s) : _M_sbuf (__s.rdbuf ()), _M_failed () {}
  void _M_put (_CharT * __ws, int __len)
  {
    if (_M_failed && _M_sbuf->sputn (__ws, __len) != __len) _M_failed = true;
  }
};
template <bool, typename _CharT>
void __copy_move_a2 (_CharT * __first,_CharT * __last,ostreambuf_iterator <_CharT> __result)
{
  int __num = __last - __first;
  __result._M_put (__first, __num);
}
template <typename _CharT>
struct basic_ios : ios_base
{
  basic_streambuf <_CharT> *rdbuf ();
};
template <typename _CharT>
struct basic_ostream : public basic_ios <_CharT>
{
};
template <typename _CharT>
struct basic_ostringstream : public basic_ostream <_CharT>
{
};
void
test01 () {
  char data1[] = "foo";
  char *beg1 = data1;
  ostringstream oss1;
  ostreambuf_iterator <char> out1 (oss1);
  out1 = copy (beg1, beg1, out1);
}