| 1 |
// { dg-do compile } |
| 2 |
// { dg-additional-options "-fcompare-debug" } |
| 3 |
|
| 4 |
template <int> struct __conditional; |
| 5 |
template <bool _Cond, typename, typename> |
| 6 |
using __conditional_t = typename __conditional<_Cond>::type; |
| 7 |
template <typename> struct __is_void_helper {}; |
| 8 |
template <typename _Tp> _Tp *__addressof(_Tp &__r) { |
| 9 |
return __builtin_addressof(__r); |
| 10 |
} |
| 11 |
template <typename _Tp> _Tp *addressof(_Tp &__r) { return __addressof(__r); } |
| 12 |
template <typename _Tp> |
| 13 |
using __make_not_void = __conditional_t<_Tp ::value, int, _Tp>; |
| 14 |
template <typename> struct pointer_traits; |
| 15 |
template <typename _Tp> struct pointer_traits<_Tp *> { |
| 16 |
typedef _Tp *pointer; |
| 17 |
typedef _Tp element_type; |
| 18 |
static pointer pointer_to(element_type &__r) { return addressof(__r); } |
| 19 |
}; |
| 20 |
namespace { |
| 21 |
template <typename> struct new_allocator; |
| 22 |
} |
| 23 |
template <typename> struct allocator_traits; |
| 24 |
template <typename> struct allocator; |
| 25 |
template <typename _Tp> struct allocator_traits<allocator<_Tp>> { |
| 26 |
using pointer = _Tp *; |
| 27 |
using const_pointer = _Tp *; |
| 28 |
}; |
| 29 |
namespace __gnu_cxx { |
| 30 |
template <typename = char> |
| 31 |
struct __alloc_traits : allocator_traits<allocator<char>> {}; |
| 32 |
} // namespace __gnu_cxx |
| 33 |
template <class> struct char_traits; |
| 34 |
template <typename _CharT, typename = _CharT> |
| 35 |
class Trans_NS___cxx11_basic_string; |
| 36 |
template <> struct char_traits<char> { |
| 37 |
typedef char char_type; |
| 38 |
static void assign(char_type, char_type); |
| 39 |
}; |
| 40 |
template <typename, typename> struct Trans_NS___cxx11_basic_string { |
| 41 |
typedef __gnu_cxx::__alloc_traits<> _Alloc_traits; |
| 42 |
typedef char_traits<char> traits_type; |
| 43 |
typedef _Alloc_traits::pointer pointer; |
| 44 |
typedef _Alloc_traits::const_pointer const_pointer; |
| 45 |
struct { |
| 46 |
pointer _M_p; |
| 47 |
} _M_dataplus; |
| 48 |
char _M_local_buf[]; |
| 49 |
void _M_data(pointer __p) { _M_dataplus._M_p = __p; } |
| 50 |
bool _M_is_local() { |
| 51 |
const_pointer __trans_tmp_5 = |
| 52 |
pointer_traits<const_pointer>::pointer_to(*_M_local_buf); |
| 53 |
return _M_dataplus._M_p == __trans_tmp_5; |
| 54 |
} |
| 55 |
void operator=(Trans_NS___cxx11_basic_string __str) { |
| 56 |
bool __trans_tmp_2; |
| 57 |
if (__str._M_is_local()) { |
| 58 |
Trans_NS___cxx11_basic_string *__trans_tmp_1; |
| 59 |
if (__builtin_expect(__trans_tmp_1 != this, true)) |
| 60 |
size(); |
| 61 |
} else if (__trans_tmp_2) |
| 62 |
__str._M_data(__str._M_local_buf); |
| 63 |
__str.clear(); |
| 64 |
} |
| 65 |
void size(); |
| 66 |
void clear() { traits_type::assign(_M_dataplus._M_p[0], char()); } |
| 67 |
}; |
| 68 |
template <class, typename, int> struct Pool { |
| 69 |
template <class T> struct PoolIterator { |
| 70 |
bool operator!=(PoolIterator); |
| 71 |
T *operator*(); |
| 72 |
void operator++(); |
| 73 |
}; |
| 74 |
template <class T> struct IterateWrapper { |
| 75 |
PoolIterator<T> begin(); |
| 76 |
PoolIterator<T> end(); |
| 77 |
}; |
| 78 |
}; |
| 79 |
struct BaseConsist { |
| 80 |
Trans_NS___cxx11_basic_string<char> name; |
| 81 |
}; |
| 82 |
struct Vehicle : BaseConsist {}; |
| 83 |
Pool<int, int, true>::IterateWrapper<Vehicle> __trans_tmp_4; |
| 84 |
Trans_NS___cxx11_basic_string<char> __trans_tmp_6; |
| 85 |
void FixOldVehicles() { |
| 86 |
for (Vehicle *v : __trans_tmp_4) |
| 87 |
v->name = __trans_tmp_6; |
| 88 |
} |