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