1// { dg-lto-do link }
2// { dg-lto-options { { -flto -std=c++11 -g2 -fno-lto-odr-type-merging -O2 } } }
3// { dg-extra-ld-options "-r -nostdlib -O2 -fno-lto-odr-type-merging" }
4namespace std
5{
6  typedef long unsigned int size_t;
7}
8extern "C"
9{
10  typedef struct
11  {
12  } __mbstate_t;
13}
14namespace std __attribute__ ((__visibility__ ("default")))
15{
16  template < class _CharT > struct char_traits;
17}
18
19typedef __mbstate_t mbstate_t;
20namespace std __attribute__ ((__visibility__ ("default")))
21{
22  template < typename _CharT, typename _Traits =
23    char_traits < _CharT > >class basic_ostream;
24  typedef basic_ostream < char >ostream;
25}
26
27using namespace std;
28class Cstring
29{
30public:
31  Cstring (const char *str, int l = 0);
32};
33extern ostream & operator << (ostream & os, const Cstring & string);
34class Foo_Log_Handler
35{
36  virtual int write_message (const char *msg, size_t msg_len, int channel,
37			     int level) = 0;
38};
39class Foo_Log_Handler_Stream:public Foo_Log_Handler
40{
41  virtual int write_message (const char *msg, size_t msg_len, int channel,
42			     int level) override;
43  Cstring m_filename;
44};
45namespace std __attribute__ ((__visibility__ ("default")))
46{
47  template <> struct char_traits <char >
48  {
49    typedef mbstate_t state_type;
50  };
51  enum _Ios_Fmtflags
52  {
53  };
54  enum _Ios_Iostate
55  {
56  };
57  class ios_base
58  {
59  public:
60    typedef _Ios_Iostate iostate;
61  };
62}
63
64namespace std __attribute__ ((__visibility__ ("default")))
65{
66  template < typename _CharT > class __ctype_abstract_base
67  {
68  };
69  template < typename _CharT > class ctype
70  {
71  public:
72    typedef char char_type;
73    mutable char _M_widen_ok;
74    char_type widen (char __c) const
75    {
76      if (_M_widen_ok)
77	return this->do_widen (__c);
78    }
79    virtual char_type do_widen (char __c) const
80    {
81    }
82  };
83  template < typename _Facet >
84    inline const _Facet & __check_facet (const _Facet * __f)
85  {
86  }
87template < typename _CharT, typename _Traits > class basic_ios:public
88    ios_base
89  {
90    typedef _CharT char_type;
91    typedef ctype < _CharT > __ctype_type;
92    const __ctype_type *_M_ctype;
93  public:
94    iostate rdstate ()const
95    {
96    }
97    bool good () const
98    {
99    }
100    char_type widen (char __c) const
101    {
102      return __check_facet (_M_ctype).widen (__c);
103    }
104  };
105template < typename _CharT, typename _Traits > class basic_ostream:virtual public basic_ios < _CharT,
106    _Traits
107    >
108  {
109  public:
110    typedef _CharT char_type;
111    typedef _Traits traits_type;
112    typedef basic_ostream < _CharT, _Traits > __ostream_type;
113    __ostream_type & operator<< (__ostream_type & (*__pf) (__ostream_type &))
114    {
115      return __pf (*this);
116    }
117    __ostream_type & put (char_type __c);
118  };
119  template < typename _CharT,
120    typename _Traits > inline basic_ostream < _CharT,
121    _Traits > &endl (basic_ostream < _CharT, _Traits > &__os)
122  {
123    return flush (__os.put (__os.widen ('\n')));
124  }
125  template < typename _CharT,
126    typename _Traits > inline basic_ostream < _CharT,
127    _Traits > &flush (basic_ostream < _CharT, _Traits > &__os)
128  {
129  }
130  extern ostream cerr;
131}
132
133int
134Foo_Log_Handler_Stream::write_message (const char *msg, size_t msg_len, int,
135					 int level)
136{
137  {
138    {
139      cerr << "FATAL: cannot write into log file: " << m_filename << endl;
140    }
141  }
142}
143