3 // { dg-options "-std=c++11 -fsanitize=undefined" }
4 // { dg-additional-options "-Wno-return-type" }
8 inline namespace __cxx11
11 template < typename > class allocator;
12 template < class _CharT > struct char_traits;
15 template < typename _CharT, typename _Traits =
16 char_traits < _CharT >, typename _Alloc =
17 allocator < _CharT > >class basic_string;
18 typedef basic_string < char >string;
23 template < typename _Tp, _Tp __v > struct integral_constant
25 static constexpr _Tp value = __v;
27 typedef integral_constant < bool, true > true_type;
31 template < typename _Tp > class new_allocator
34 typedef long unsigned size_type;
35 typedef _Tp value_type;
36 template < typename _Tp1 > struct rebind
38 typedef new_allocator < _Tp1 > other;
44 template < typename _Tp > using __allocator_base =
45 __gnu_cxx::new_allocator < _Tp >;
46 template < typename _Tp > class allocator:public __allocator_base < _Tp >
49 template < typename _Alloc, typename _Tp > class __alloctr_rebind_helper
51 template < typename _Alloc2, typename _Tp2 >
52 static constexpr true_type _S_chk (typename _Alloc2::template rebind <
55 using __type = decltype (_S_chk < _Alloc, _Tp > (nullptr));
57 template < typename _Alloc, typename _Tp, bool =
58 __alloctr_rebind_helper < _Alloc,
59 _Tp >::__type::value > struct __alloctr_rebind;
60 template < typename _Alloc, typename _Tp > struct __alloctr_rebind <_Alloc,
63 typedef typename _Alloc::template rebind < _Tp >::other __type;
65 template < typename _Alloc > struct allocator_traits
67 typedef typename _Alloc::value_type value_type;
68 static value_type *_S_pointer_helper (...);
69 typedef decltype (_S_pointer_helper ((_Alloc *) 0)) __pointer;
70 typedef __pointer pointer;
71 template < typename _Tp >
72 static typename _Tp::size_type _S_size_type_helper (_Tp *);
73 typedef decltype (_S_size_type_helper ((_Alloc *) 0)) __size_type;
74 typedef __size_type size_type;
75 template < typename _Tp > using rebind_alloc =
76 typename __alloctr_rebind < _Alloc, _Tp >::__type;
81 template < typename _Alloc > struct __alloc_traits:std::allocator_traits <
84 typedef std::allocator_traits < _Alloc > _Base_type;
85 template < typename _Tp > struct rebind
87 typedef typename _Base_type::template rebind_alloc < _Tp > other;
95 template < typename _CharT, typename _Traits,
96 typename _Alloc > class basic_string
98 typedef typename __gnu_cxx::__alloc_traits < _Alloc >::template rebind <
99 _CharT >::other _Char_alloc_type;
100 typedef __gnu_cxx::__alloc_traits < _Char_alloc_type > _Alloc_traits;
101 typedef _Char_alloc_type allocator_type;
102 typedef typename _Alloc_traits::size_type size_type;
103 typedef typename _Alloc_traits::pointer pointer;
104 struct _Alloc_hider:allocator_type
106 _Alloc_hider (pointer __dat, const _Alloc & __a)
110 _Alloc_hider _M_dataplus;
113 size_type _M_allocated_capacity;
115 pointer _M_local_data ()
120 _M_destroy (_M_allocated_capacity);
122 void _M_destroy (size_type __size) throw ()
126 basic_string (const _CharT * __s, const _Alloc & __a = _Alloc ()):_M_dataplus (_M_local_data (),
136 FileHandle (const char *fname);
138 FileHandle::FileHandle (const char *fname):fname (fname)