2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr39732.C
blob44edbf5ba90b464fcdd5cf557440d5356e308722
1 /* { dg-do compile } */
2 /* { dg-require-profiling "-fprofile-generate" } */
3 /* { dg-options "-fprofile-generate" } */
5 template<class _CharT>     struct char_traits;
6 template<typename _OI>
7 _OI __copy_move_a2(_OI __result);
8 template<typename _OI>     inline _OI
9 copy(_OI __result)
11   return __copy_move_a2 (__result);
13 template<typename _CharT, typename _Traits>
14 class basic_ostream     { };
15 template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT> >
16 class ostream_iterator      {
17     typedef basic_ostream<_CharT, _Traits> ostream_type;
18     ostream_type* _M_stream;
19     const _CharT* _M_string;
20 public:
21     ostream_iterator(ostream_type& __s, const _CharT* __c)
22         : _M_stream(&__s), _M_string(__c) { }
23     ostream_iterator(const ostream_iterator& __obj)
24         : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
26 int f(void)
28   basic_ostream<char, char_traits<char> > os;
29   copy(ostream_iterator<const int>(os, ","));
30   return 0;