]>
Commit | Line | Data |
---|---|---|
b1905808 | 1 | /* { dg-lto-do link } */ |
b1905808 | 2 | /* { dg-extra-ld-options { -O2 -Wno-odr -r -nostdlib } } */ |
19520957 ML |
3 | /* { dg-lto-options { "-O2 -w -Wno-return-type" } } */ |
4 | ||
b1905808 JH |
5 | namespace std |
6 | { | |
7 | template < class > struct char_traits; | |
8 | typedef long streamsize; | |
9 | template < typename, typename > class basic_streambuf; | |
10 | template < typename > class A; | |
11 | template < typename, typename > class basic_ostream; | |
12 | template < typename _CharT, typename = | |
13 | char_traits < _CharT > >class istreambuf_iterator; | |
14 | template < typename _CharT, typename = | |
15 | char_traits < _CharT > >class ostreambuf_iterator; | |
16 | template < typename > class ctype; | |
17 | template < typename _CharT, typename = | |
18 | istreambuf_iterator < _CharT > >class num_get; | |
19 | template < typename _CharT, typename = | |
20 | ostreambuf_iterator < _CharT > >class num_put; | |
21 | } | |
22 | typedef int _Atomic_word; | |
23 | namespace std | |
24 | { | |
25 | class locale | |
26 | { | |
92bed036 | 27 | public: |
b1905808 | 28 | class facet; |
92bed036 | 29 | private: |
b1905808 JH |
30 | class _Impl; |
31 | _Impl *_M_impl; | |
32 | }; | |
33 | class locale::facet | |
34 | { | |
35 | _Atomic_word _M_refcount; | |
36 | protected: | |
37 | virtual ~ facet (); | |
38 | }; | |
39 | enum _Ios_Fmtflags | |
40 | { _S_boolalpha = 1, _S_dec, _S_fixed = 1 << 2, _S_hex = | |
41 | 1 << 3, _S_internal = 1 << 4, _S_left = 1 << 5, _S_oct = | |
42 | 1 << 6, _S_right = 1 << 7, _S_scientific = 1 << 8, _S_showbase = | |
43 | 1 << 9, _S_showpoint = 1 << 10, _S_showpos = 1 << 11, _S_skipws = | |
44 | 1 << 12, _S_unitbuf = 1 << 13, _S_uppercase = 1 << 14, _S_adjustfield = | |
45 | _S_left | _S_right | _S_internal, _S_basefield = | |
46 | _S_dec | _S_oct | _S_hex, _S_floatfield = | |
47 | _S_scientific | _S_fixed, _S_ios_fmtflags_end = 1 << 16 | |
48 | }; | |
49 | enum _Ios_Iostate | |
50 | { _S_goodbit, _S_badbit, _S_eofbit, _S_failbit = | |
51 | 1 << 2, _S_ios_iostate_end = 1 << 16 | |
52 | }; | |
53 | class ios_base | |
54 | { | |
55 | typedef _Ios_Fmtflags fmtflags; | |
56 | typedef _Ios_Iostate iostate; | |
57 | streamsize _M_precision; | |
58 | streamsize _M_width; | |
59 | fmtflags _M_flags; | |
60 | iostate _M_exception; | |
61 | iostate _M_streambuf_state; | |
62 | struct _Callback_list; | |
63 | _Callback_list *_M_callbacks; | |
64 | struct _Words | |
65 | { | |
66 | void *_M_pword; | |
67 | long _M_iword; | |
68 | } _M_word_zero; | |
69 | enum | |
70 | { _S_local_word_size = 8 }; | |
71 | _Words _M_local_word[_S_local_word_size]; | |
72 | int _M_word_size; | |
73 | _Words *_M_word; | |
74 | locale _M_ios_locale; | |
92bed036 | 75 | protected: |
b1905808 JH |
76 | virtual ~ ios_base (); |
77 | }; | |
78 | template < typename, typename > class istreambuf_iterator | |
79 | { | |
80 | typedef A < char_traits < wchar_t > >istream_type; | |
81 | }; | |
82 | template < typename, typename > class ostreambuf_iterator | |
83 | { | |
84 | typedef basic_ostream < wchar_t, char_traits < wchar_t > >ostream_type; | |
85 | }; | |
86 | template < typename, typename > class num_get:locale::facet | |
87 | { | |
88 | public: | |
89 | typedef istreambuf_iterator < wchar_t > iter_type; | |
90 | }; | |
91 | template < typename, typename > class num_put:locale::facet | |
92 | { | |
93 | public: | |
94 | typedef ostreambuf_iterator < wchar_t > iter_type; | |
95 | }; | |
96 | template < typename, typename > class basic_ios:ios_base | |
97 | { | |
98 | typedef wchar_t char_type; | |
99 | basic_ostream < wchar_t, char_traits < wchar_t > >*_M_tie; | |
100 | char_type _M_fill; | |
101 | bool _M_fill_init; | |
102 | basic_streambuf < wchar_t, char_traits < wchar_t > >*_M_streambuf; | |
103 | ctype < wchar_t > *_M_ctype; | |
104 | num_put < wchar_t > *_M_num_put; | |
105 | num_get < wchar_t > *_M_num_get; | |
106 | }; | |
107 | template < typename, typename > class basic_ostream:virtual basic_ios < wchar_t, | |
108 | char_traits < wchar_t > | |
109 | > | |
110 | { | |
111 | typedef basic_ios __ios_type; | |
112 | }; | |
113 | template < typename > class A:basic_ios < wchar_t, int > | |
114 | { | |
115 | }; | |
116 | class B:A < char_traits < wchar_t > >, basic_ostream < wchar_t, | |
117 | char_traits < wchar_t > > | |
118 | { | |
119 | }; | |
120 | } | |
121 | ||
122 | class C: | |
123 | std::num_put < | |
124 | wchar_t > | |
125 | { | |
126 | public: | |
127 | C (int); | |
128 | iter_type | |
129 | do_put_out; | |
130 | }; | |
131 | class | |
132 | D: | |
133 | std::num_get < | |
134 | wchar_t > | |
135 | { | |
136 | public: | |
137 | D (int); | |
138 | iter_type | |
139 | do_get_in; | |
140 | }; | |
141 | template < typename > void | |
142 | install_formatting_facets (std::locale, int p2) | |
143 | { | |
144 | (C (p2)); | |
145 | } | |
146 | ||
147 | template < typename > void | |
148 | install_parsing_facets (std::locale, int p2) | |
149 | { | |
150 | (D (p2)); | |
151 | } | |
152 | ||
153 | std::locale a; | |
154 | int b; | |
155 | void | |
156 | create_formatting () | |
157 | { | |
158 | install_formatting_facets < wchar_t > (a, b); | |
159 | install_parsing_facets < wchar_t > (a, b); | |
160 | } |