From bca672f610c270de56a934b1ed14bd38f24c5bbe Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 8 Jun 2012 23:18:38 -0700 Subject: [PATCH] re PR c++/53602 (Libre Office causes an internal compiler error) PR c++/53602 From-SVN: r188358 --- gcc/testsuite/g++.dg/torture/pr53602.C | 365 +++++++++++++++++++++++++++++++++ 1 file changed, 365 insertions(+) create mode 100644 gcc/testsuite/g++.dg/torture/pr53602.C diff --git a/gcc/testsuite/g++.dg/torture/pr53602.C b/gcc/testsuite/g++.dg/torture/pr53602.C new file mode 100644 index 0000000..1bb9cf4 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr53602.C @@ -0,0 +1,365 @@ +// { dg-do compile } +// { dg-options "-std=c++11" } + +namespace std +{ + template + struct pair + { + }; + struct input_iterator_tag + { + }; + struct forward_iterator_tag : public input_iterator_tag + { + }; + template + struct iterator + { + }; +} +namespace __gnu_cxx +{ + template + struct new_allocator + { + typedef _Tp pointer; + typedef _Tp value_type; + template + struct rebind + { + typedef new_allocator <_Tp1> other; + }; + }; +} +namespace std +{ + template + struct allocator : public __gnu_cxx::new_allocator <_Tp> + { + }; +} +extern "C" +{ + struct rtl_String; + void rtl_string_release (rtl_String *) throw (); + void rtl_string_newFromStr (rtl_String * *, const char *) throw (); +} +namespace std +{ + template struct binary_function; + template + struct equal_to : public binary_function <_Tp, _Tp, bool> + { + }; +} +namespace rtl +{ + struct OString + { + rtl_String * pData; + OString (const char *value) + { + rtl_string_newFromStr (&pData, value); + } + ~OString () + { + rtl_string_release (pData); + } + }; + struct OStringHash; +} +namespace boost +{ + template struct hash; + namespace unordered + { + template , class = std::equal_to , class = std::allocator >class unordered_set; + } + using boost::unordered::unordered_set; + namespace detail + { + template + struct if_true + { + template + struct then + { + typedef F type; + }; + }; + } + template struct pointer_to_other; + template + struct pointer_to_other + { + typedef U type; + }; + namespace unordered + { + namespace detail + { + template struct integral_constant + { + }; + struct choice9 + { + typedef char (&type)[9]; + }; + struct choice8:choice9 + { + }; + struct choice7:choice8 + { + }; + struct choice6:choice7 + { + }; + struct choice5:choice6 + { + }; + struct choice4:choice5 + { + }; + struct choice3:choice4 + { + }; + struct choice2:choice3 + { + }; + struct choice1:choice2 + { + }; + choice1 choose (); + template + struct rebind_wrap + { + typedef typename Alloc::template rebind ::other type; + }; + template + struct sfinae:T2 + { + }; + template + struct default_type_pointer + { + template + static boost::unordered::detail::sfinae test (choice1); + struct DefaultWrap + { + typedef Default pointer; + }; + enum { value = (1 == sizeof (test (choose ()))) }; + typedef typename boost::detail::if_true ::template then ::type::pointer type; + }; + template + struct default_type_const_pointer + { + template + static choice2::type test (choice2); + struct DefaultWrap + { + }; + enum { value = (1 == sizeof (test (choose ()))) }; + typedef typename boost::detail::if_true ::template then type; + }; + struct default_type_propagate_on_container_swap + { + struct DefaultWrap + { + }; + }; + template + struct allocator_traits + { + typedef typename Alloc::value_type value_type; + typedef typename default_type_pointer ::type pointer; + template + struct pointer_to_other : boost::pointer_to_other + { + }; + typedef typename default_type_const_pointer ::type>::type const_pointer; + }; + } + namespace detail + { + struct move_tag + { + }; + template struct table; + template + struct node_constructor + { + void construct_value () + { + } + }; + struct ptr_bucket + { + ptr_bucket () + { + } + }; + template + struct buckets + { + typedef Node node; + typedef Bucket bucket; + typedef typename boost::unordered::detail::rebind_wrap ::type node_allocator; + typedef typename boost::unordered::detail::rebind_wrap ::type bucket_allocator; + typedef boost::unordered::detail::allocator_traits node_allocator_traits; + typedef boost::unordered::detail::allocator_traits bucket_allocator_traits; + typedef typename node_allocator_traits::pointer node_pointer; + typedef typename node_allocator_traits::const_pointer const_node_pointer; + typedef typename bucket_allocator_traits::pointer bucket_pointer; + typedef boost::unordered::detail::node_constructor node_constructor; + bucket_pointer buckets_; + unsigned size_; + template + buckets (boost::unordered::detail::table , boost::unordered::detail::move_tag) : buckets_ (), size_ () + { + } + }; + struct functions + { + }; + } + } + namespace detail + { + template + struct iterator_base:std::iterator + { + }; + } + template + struct iterator:boost::detail::iterator_base + { + }; + namespace unordered + { + namespace iterator_detail + { + template struct c_iterator:public boost::iterator + { + friend bool operator== (c_iterator, c_iterator) + { + } + }; + } + namespace detail + { + template + struct value_base + { + typedef ValueType value_type; + value_type value () + { + } + }; + template + struct table:boost::unordered::detail::buckets + { + typedef typename Types::value_type value_type; + typedef boost::unordered::detail::buckets buckets; + typedef typename buckets::node_pointer node_pointer; + typedef typename buckets::const_node_pointer const_node_pointer; + typedef boost::unordered::iterator_detail::c_iterator c_iterator; + unsigned max_size () + { + } + }; + template struct table_impl; + template + struct ptr_node : boost::unordered::detail::value_base , boost::unordered::detail::ptr_bucket + { + boost::unordered::detail::ptr_bucket bucket_base; + unsigned hash_; + ptr_node () : bucket_base (), hash_ () + { + } + }; + template struct pick_node2 + { + }; + template struct pick_node2 *, boost::unordered::detail::ptr_bucket *> + { + typedef boost::unordered::detail::ptr_node node; + typedef boost::unordered::detail::ptr_bucket bucket; + }; + template struct pick_node + { + typedef boost::unordered::detail::allocator_traits >::type> tentative_node_traits; + typedef boost::unordered::detail::allocator_traits ::type> tentative_bucket_traits; + typedef pick_node2 pick; + typedef typename pick::node node; + typedef typename pick::bucket bucket; + }; + template + struct set + { + typedef boost::unordered::detail::set types; + typedef T value_type; + typedef P key_equal; + typedef typename boost::unordered::detail::rebind_wrap ::type allocator; + typedef boost::unordered::detail::pick_node pick; + typedef typename pick::node node; + typedef typename pick::bucket bucket; + typedef boost::unordered::detail::table_impl table; + }; + template + struct table_impl : boost::unordered::detail::table + { + typedef boost::unordered::detail::table table; + typedef typename table::node_constructor node_constructor; + table_impl () : table () + { + } + template + void insert_range_impl2 (node_constructor, InputIt) + { + } + }; + } + template + struct unordered_set + { + typedef T key_type; + typedef T value_type; + typedef boost::unordered::detail::set types; + typedef typename types::table table; + typedef typename table::c_iterator const_iterator; + typedef typename table::c_iterator iterator; + table table_; + bool empty () + { + return table_.size_; + } + iterator end () + { + } + std::pair insert (value_type) + { + } + unsigned erase (const key_type &); + const_iterator find (const key_type); + }; + template + unsigned unordered_set ::erase (const key_type &) + { + } + } +} +using namespace::rtl; +namespace skeletonmaker +{ + void + checkDefaultInterfaces (boost::unordered_set interfaces, + boost::unordered_set services, OString) + { + if (services.empty ()) + interfaces.erase ("com.sun.star.lang.XServiceInfo"); + else if (interfaces.find ("com.sun.star.lang.XServiceInfo") == interfaces.end ()) + interfaces.insert ("com.sun.star.lang.XServiceInfo"); + } +} -- 2.7.4