Debian Codegraph @

gcc/testsuite/g++.dg/lto/pr65316_0.C

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