1// { dg-do compile { target c++11 } } 2 3namespace std 4{ 5 template <class, class> 6 struct pair 7 { 8 }; 9 struct input_iterator_tag 10 { 11 }; 12 struct forward_iterator_tag : public input_iterator_tag 13 { 14 }; 15 template <typename, typename _Tp, typename = _Tp> 16 struct iterator 17 { 18 }; 19} 20namespace __gnu_cxx 21{ 22 template <typename _Tp> 23 struct new_allocator 24 { 25 typedef _Tp pointer; 26 typedef _Tp value_type; 27 template <typename _Tp1> 28 struct rebind 29 { 30 typedef new_allocator <_Tp1> other; 31 }; 32 }; 33} 34namespace std 35{ 36 template <typename _Tp> 37 struct allocator : public __gnu_cxx::new_allocator <_Tp> 38 { 39 }; 40} 41extern "C" 42{ 43 struct rtl_String; 44 void rtl_string_release (rtl_String *) throw (); 45 void rtl_string_newFromStr (rtl_String * *, const char *) throw (); 46} 47namespace std 48{ 49 template <typename, typename, typename> struct binary_function; 50 template <typename _Tp> 51 struct equal_to : public binary_function <_Tp, _Tp, bool> 52 { 53 }; 54} 55namespace rtl 56{ 57 struct OString 58 { 59 rtl_String * pData; 60 OString (const char *value) 61 { 62 rtl_string_newFromStr (&pData, value); 63 } 64 ~OString () 65 { 66 rtl_string_release (pData); 67 } 68 }; 69 struct OStringHash; 70} 71namespace boost 72{ 73 template <class> struct hash; 74 namespace unordered 75 { 76 template <class T, class = boost::hash <T>, class = std::equal_to <T>, class = std::allocator <T>>class unordered_set; 77 } 78 using boost::unordered::unordered_set; 79 namespace detail 80 { 81 template <bool> 82 struct if_true 83 { 84 template <class, class F> 85 struct then 86 { 87 typedef F type; 88 }; 89 }; 90 } 91 template <class, class> struct pointer_to_other; 92 template <class T, class U> 93 struct pointer_to_other <T *, U> 94 { 95 typedef U type; 96 }; 97 namespace unordered 98 { 99 namespace detail 100 { 101 template <typename T, T> struct integral_constant 102 { 103 }; 104 struct choice9 105 { 106 typedef char (&type)[9]; 107 }; 108 struct choice8:choice9 109 { 110 }; 111 struct choice7:choice8 112 { 113 }; 114 struct choice6:choice7 115 { 116 }; 117 struct choice5:choice6 118 { 119 }; 120 struct choice4:choice5 121 { 122 }; 123 struct choice3:choice4 124 { 125 }; 126 struct choice2:choice3 127 { 128 }; 129 struct choice1:choice2 130 { 131 }; 132 choice1 choose (); 133 template <typename Alloc, typename T> 134 struct rebind_wrap 135 { 136 typedef typename Alloc::template rebind <T>::other type; 137 }; 138 template <typename, typename T2> 139 struct sfinae:T2 140 { 141 }; 142 template <typename Tp, typename Default> 143 struct default_type_pointer 144 { 145 template <typename X> 146 static boost::unordered::detail::sfinae <typename X::pointer, choice1> test (choice1); 147 struct DefaultWrap 148 { 149 typedef Default pointer; 150 }; 151 enum { value = (1 == sizeof (test <Tp> (choose ()))) }; 152 typedef typename boost::detail::if_true <value>::template then <Tp, DefaultWrap>::type::pointer type; 153 }; 154 template <typename Tp, typename Default> 155 struct default_type_const_pointer 156 { 157 template <typename> 158 static choice2::type test (choice2); 159 struct DefaultWrap 160 { 161 }; 162 enum { value = (1 == sizeof (test <Tp> (choose ()))) }; 163 typedef typename boost::detail::if_true <value>::template then <Tp, DefaultWrap> type; 164 }; 165 struct default_type_propagate_on_container_swap 166 { 167 struct DefaultWrap 168 { 169 }; 170 }; 171 template <typename Alloc> 172 struct allocator_traits 173 { 174 typedef typename Alloc::value_type value_type; 175 typedef typename default_type_pointer <Alloc, value_type *>::type pointer; 176 template <typename T> 177 struct pointer_to_other : boost::pointer_to_other <pointer, T> 178 { 179 }; 180 typedef typename default_type_const_pointer <Alloc, typename pointer_to_other <value_type>::type>::type const_pointer; 181 }; 182 } 183 namespace detail 184 { 185 struct move_tag 186 { 187 }; 188 template <typename> struct table; 189 template <typename NodeAlloc> 190 struct node_constructor 191 { 192 void construct_value () 193 { 194 } 195 }; 196 struct ptr_bucket 197 { 198 ptr_bucket () 199 { 200 } 201 }; 202 template <typename A, typename Bucket, typename Node> 203 struct buckets 204 { 205 typedef Node node; 206 typedef Bucket bucket; 207 typedef typename boost::unordered::detail::rebind_wrap <A, node>::type node_allocator; 208 typedef typename boost::unordered::detail::rebind_wrap <A, bucket>::type bucket_allocator; 209 typedef boost::unordered::detail::allocator_traits <node_allocator> node_allocator_traits; 210 typedef boost::unordered::detail::allocator_traits <bucket_allocator> bucket_allocator_traits; 211 typedef typename node_allocator_traits::pointer node_pointer; 212 typedef typename node_allocator_traits::const_pointer const_node_pointer; 213 typedef typename bucket_allocator_traits::pointer bucket_pointer; 214 typedef boost::unordered::detail::node_constructor <node_allocator> node_constructor; 215 bucket_pointer buckets_; 216 unsigned size_; 217 template <typename Types> 218 buckets (boost::unordered::detail::table <Types>, boost::unordered::detail::move_tag) : buckets_ (), size_ () 219 { 220 } 221 }; 222 struct functions 223 { 224 }; 225 } 226 } 227 namespace detail 228 { 229 template <class Category, class T, class, class, class> 230 struct iterator_base:std::iterator <Category, T> 231 { 232 }; 233 } 234 template <class Category, class T, class Distance, class Pointer = T, class Reference = T> 235 struct iterator:boost::detail::iterator_base <Category, T, Distance, Pointer, Reference> 236 { 237 }; 238 namespace unordered 239 { 240 namespace iterator_detail 241 { 242 template <typename, typename NodePointer, typename Value> struct c_iterator:public boost::iterator <std::forward_iterator_tag, Value, int> 243 { 244 friend bool operator== (c_iterator, c_iterator) 245 { 246 } 247 }; 248 } 249 namespace detail 250 { 251 template <typename ValueType> 252 struct value_base 253 { 254 typedef ValueType value_type; 255 value_type value () 256 { 257 } 258 }; 259 template <typename Types> 260 struct table:boost::unordered::detail::buckets <typename Types::allocator, typename Types::bucket, typename Types::key_equal> 261 { 262 typedef typename Types::value_type value_type; 263 typedef boost::unordered::detail::buckets <typename Types::allocator, typename Types::bucket, typename Types::node> buckets; 264 typedef typename buckets::node_pointer node_pointer; 265 typedef typename buckets::const_node_pointer const_node_pointer; 266 typedef boost::unordered::iterator_detail::c_iterator <const_node_pointer, node_pointer, value_type> c_iterator; 267 unsigned max_size () 268 { 269 } 270 }; 271 template <typename> struct table_impl; 272 template <typename T> 273 struct ptr_node : boost::unordered::detail::value_base <T>, boost::unordered::detail::ptr_bucket 274 { 275 boost::unordered::detail::ptr_bucket bucket_base; 276 unsigned hash_; 277 ptr_node () : bucket_base (), hash_ () 278 { 279 } 280 }; 281 template <typename A, typename T, typename, typename> struct pick_node2 282 { 283 }; 284 template <typename A, typename T> struct pick_node2 <A, T, boost::unordered::detail::ptr_node <T> *, boost::unordered::detail::ptr_bucket *> 285 { 286 typedef boost::unordered::detail::ptr_node <T> node; 287 typedef boost::unordered::detail::ptr_bucket bucket; 288 }; 289 template <typename A, typename T> struct pick_node 290 { 291 typedef boost::unordered::detail::allocator_traits <typename boost::unordered::detail::rebind_wrap <A, boost::unordered::detail::ptr_node <T>>::type> tentative_node_traits; 292 typedef boost::unordered::detail::allocator_traits <typename boost::unordered::detail::rebind_wrap <A, boost::unordered::detail::ptr_bucket>::type> tentative_bucket_traits; 293 typedef pick_node2 <A, T, typename tentative_node_traits::pointer, typename tentative_bucket_traits::pointer> pick; 294 typedef typename pick::node node; 295 typedef typename pick::bucket bucket; 296 }; 297 template <typename A, typename T, typename H, typename P> 298 struct set 299 { 300 typedef boost::unordered::detail::set <A, T, H, P> types; 301 typedef T value_type; 302 typedef P key_equal; 303 typedef typename boost::unordered::detail::rebind_wrap <A, value_type>::type allocator; 304 typedef boost::unordered::detail::pick_node <allocator, value_type> pick; 305 typedef typename pick::node node; 306 typedef typename pick::bucket bucket; 307 typedef boost::unordered::detail::table_impl <types> table; 308 }; 309 template <typename Types> 310 struct table_impl : boost::unordered::detail::table <Types> 311 { 312 typedef boost::unordered::detail::table <Types> table; 313 typedef typename table::node_constructor node_constructor; 314 table_impl () : table () 315 { 316 } 317 template <class InputIt> 318 void insert_range_impl2 (node_constructor, InputIt) 319 { 320 } 321 }; 322 } 323 template <class T, class H, class P, class A> 324 struct unordered_set 325 { 326 typedef T key_type; 327 typedef T value_type; 328 typedef boost::unordered::detail::set <A, T, H, P> types; 329 typedef typename types::table table; 330 typedef typename table::c_iterator const_iterator; 331 typedef typename table::c_iterator iterator; 332 table table_; 333 bool empty () 334 { 335 return table_.size_; 336 } 337 iterator end () 338 { 339 } 340 std::pair <iterator, bool> insert (value_type) 341 { 342 } 343 unsigned erase (const key_type &); 344 const_iterator find (const key_type); 345 }; 346 template <class T, class H, class P, class A> 347 unsigned unordered_set <T, H, P, A>::erase (const key_type &) 348 { 349 } 350 } 351} 352using namespace::rtl; 353namespace skeletonmaker 354{ 355 void 356 checkDefaultInterfaces (boost::unordered_set <OString, OStringHash> interfaces, 357 boost::unordered_set <OStringHash> services, OString) 358 { 359 if (services.empty ()) 360 interfaces.erase ("com.sun.star.lang.XServiceInfo"); 361 else if (interfaces.find ("com.sun.star.lang.XServiceInfo") == interfaces.end ()) 362 interfaces.insert ("com.sun.star.lang.XServiceInfo"); 363 } 364} 365