2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / lto / pr65475c_0.C
blob73686918c2cfd09285c10074114077677e76a746
1 /* { dg-lto-do link } */
2 /* { dg-extra-ld-options { -O2 -Wno-odr -r -nostdlib } } */
3 /* { dg-lto-options { "-O2 -w -Wno-return-type" } } */
5 namespace std
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;
22 typedef int _Atomic_word;
23 namespace std
25 class locale
27     class facet;
28     class _Impl;
29     _Impl *_M_impl;
31 class locale::facet
33     _Atomic_word _M_refcount;
34 protected:
35     virtual ~ facet ();
37 enum _Ios_Fmtflags
38 {   _S_boolalpha = 1, _S_dec, _S_fixed = 1 << 2, _S_hex =
39         1 << 3, _S_internal = 1 << 4, _S_left = 1 << 5, _S_oct =
40             1 << 6, _S_right = 1 << 7, _S_scientific = 1 << 8, _S_showbase =
41                 1 << 9, _S_showpoint = 1 << 10, _S_showpos = 1 << 11, _S_skipws =
42                     1 << 12, _S_unitbuf = 1 << 13, _S_uppercase = 1 << 14, _S_adjustfield =
43                         _S_left | _S_right | _S_internal, _S_basefield =
44                             _S_dec | _S_oct | _S_hex, _S_floatfield =
45                                 _S_scientific | _S_fixed, _S_ios_fmtflags_end = 1 << 16
47 enum _Ios_Iostate
48 {   _S_goodbit, _S_badbit, _S_eofbit, _S_failbit =
49         1 << 2, _S_ios_iostate_end = 1 << 16
51 class ios_base
53     typedef _Ios_Fmtflags fmtflags;
54     typedef _Ios_Iostate iostate;
55     streamsize _M_precision;
56     streamsize _M_width;
57     fmtflags _M_flags;
58     iostate _M_exception;
59     iostate _M_streambuf_state;
60     struct _Callback_list;
61     _Callback_list *_M_callbacks;
62     struct _Words
63     {
64         void *_M_pword;
65         long _M_iword;
66     } _M_word_zero;
67     enum
68     { _S_local_word_size = 8 };
69     _Words _M_local_word[_S_local_word_size];
70     int _M_word_size;
71     _Words *_M_word;
72     locale _M_ios_locale;
73     virtual ~ ios_base ();
75 template < typename, typename > class istreambuf_iterator
77     typedef A < char_traits < wchar_t > >istream_type;
79 template < typename, typename > class ostreambuf_iterator
81     typedef basic_ostream < wchar_t, char_traits < wchar_t > >ostream_type;
83 template < typename, typename > class num_get:locale::facet
85 public:
86     typedef istreambuf_iterator < wchar_t > iter_type;
88 template < typename, typename > class num_put:locale::facet
90 public:
91     typedef ostreambuf_iterator < wchar_t > iter_type;
93 template < typename, typename > class basic_ios:ios_base
95     typedef wchar_t char_type;
96     basic_ostream < wchar_t, char_traits < wchar_t > >*_M_tie;
97     char_type _M_fill;
98     bool _M_fill_init;
99     basic_streambuf < wchar_t, char_traits < wchar_t > >*_M_streambuf;
100     ctype < wchar_t > *_M_ctype;
101     num_put < wchar_t > *_M_num_put;
102     num_get < wchar_t > *_M_num_get;
104 template < typename, typename > class basic_ostream:virtual basic_ios < wchar_t,
105     char_traits < wchar_t >
106     >
108     typedef basic_ios __ios_type;
110 template < typename > class A:basic_ios < wchar_t, int >
113 class B:A < char_traits < wchar_t > >, basic_ostream < wchar_t,
114     char_traits < wchar_t > >
119 class C:
120     std::num_put <
121     wchar_t >
123 public:
124     C (int);
125     iter_type
126     do_put_out;
128 class
129     D:
130     std::num_get <
131     wchar_t >
133 public:
134     D (int);
135     iter_type
136     do_get_in;
138 template < typename > void
139 install_formatting_facets (std::locale, int p2)
141     (C (p2));
144 template < typename > void
145 install_parsing_facets (std::locale, int p2)
147     (D (p2));
150 std::locale a;
151 int b;
152 void
153 create_formatting ()
155     install_formatting_facets < wchar_t > (a, b);
156     install_parsing_facets < wchar_t > (a, b);