3 // { dg-options "-std=c++11 -fsanitize=undefined -Wno-return-type" }
7 inline namespace __cxx11
10 template < typename > class allocator;
11 template < class _CharT > struct char_traits;
14 template < typename _CharT, typename _Traits =
15 char_traits < _CharT >, typename _Alloc =
16 allocator < _CharT > >class basic_string;
17 typedef basic_string < char >string;
22 template < typename _Tp, _Tp __v > struct integral_constant
24 static constexpr _Tp value = __v;
26 typedef integral_constant < bool, true > true_type;
30 template < typename _Tp > class new_allocator
33 typedef long unsigned size_type;
34 typedef _Tp value_type;
35 template < typename _Tp1 > struct rebind
37 typedef new_allocator < _Tp1 > other;
43 template < typename _Tp > using __allocator_base =
44 __gnu_cxx::new_allocator < _Tp >;
45 template < typename _Tp > class allocator:public __allocator_base < _Tp >
48 template < typename _Alloc, typename _Tp > class __alloctr_rebind_helper
50 template < typename _Alloc2, typename _Tp2 >
51 static constexpr true_type _S_chk (typename _Alloc2::template rebind <
54 using __type = decltype (_S_chk < _Alloc, _Tp > (nullptr));
56 template < typename _Alloc, typename _Tp, bool =
57 __alloctr_rebind_helper < _Alloc,
58 _Tp >::__type::value > struct __alloctr_rebind;
59 template < typename _Alloc, typename _Tp > struct __alloctr_rebind <_Alloc,
62 typedef typename _Alloc::template rebind < _Tp >::other __type;
64 template < typename _Alloc > struct allocator_traits
66 typedef typename _Alloc::value_type value_type;
67 static value_type *_S_pointer_helper (...);
68 typedef decltype (_S_pointer_helper ((_Alloc *) 0)) __pointer;
69 typedef __pointer pointer;
70 template < typename _Tp >
71 static typename _Tp::size_type _S_size_type_helper (_Tp *);
72 typedef decltype (_S_size_type_helper ((_Alloc *) 0)) __size_type;
73 typedef __size_type size_type;
74 template < typename _Tp > using rebind_alloc =
75 typename __alloctr_rebind < _Alloc, _Tp >::__type;
80 template < typename _Alloc > struct __alloc_traits:std::allocator_traits <
83 typedef std::allocator_traits < _Alloc > _Base_type;
84 template < typename _Tp > struct rebind
86 typedef typename _Base_type::template rebind_alloc < _Tp > other;
94 template < typename _CharT, typename _Traits,
95 typename _Alloc > class basic_string
97 typedef typename __gnu_cxx::__alloc_traits < _Alloc >::template rebind <
98 _CharT >::other _Char_alloc_type;
99 typedef __gnu_cxx::__alloc_traits < _Char_alloc_type > _Alloc_traits;
100 typedef _Char_alloc_type allocator_type;
101 typedef typename _Alloc_traits::size_type size_type;
102 typedef typename _Alloc_traits::pointer pointer;
103 struct _Alloc_hider:allocator_type
105 _Alloc_hider (pointer __dat, const _Alloc & __a)
109 _Alloc_hider _M_dataplus;
112 size_type _M_allocated_capacity;
114 pointer _M_local_data ()
119 _M_destroy (_M_allocated_capacity);
121 void _M_destroy (size_type __size) throw ()
125 basic_string (const _CharT * __s, const _Alloc & __a = _Alloc ()):_M_dataplus (_M_local_data (),
135 FileHandle (const char *fname);
137 FileHandle::FileHandle (const char *fname):fname (fname)