From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3140 invoked by alias); 12 Sep 2014 14:55:03 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2730 invoked by uid 48); 12 Sep 2014 14:54:59 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/63226] ICE with -flto-odr-type-merging Date: Fri, 12 Sep 2014 14:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg01515.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63226 --- Comment #5 from Tobias Burnus --- Created attachment 33478 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33478&action=edit Second test file pair (1/2): one37.ii namespace std { template struct unary_function { }; } namespace mpl_ { } namespace mpl_ { template< bool C_ > struct bool_ { }; template< typename T, T N > struct integral_c; } namespace boost { namespace mpl { using ::mpl_::integral_c; } } namespace mpl_ { template< typename T, T N > struct integral_c { static const T value = N; }; } namespace boost{ template struct integral_constant : public mpl::integral_c { }; namespace detail { template struct cv_traits_imp { typedef T unqualified_type; }; }; template< typename T > struct is_void : ::boost::integral_constant { }; template< typename T > struct is_integral : ::boost::integral_constant { }; namespace type_traits { template struct is_mem_fun_pointer_impl { static const bool value = false; }; } template< typename T > struct remove_cv { typedef typename boost::detail::cv_traits_imp::unqualified_type type; }; template< typename T > struct is_member_function_pointer : ::boost::integral_constant::type>::value> { }; template< typename T > struct is_member_pointer : ::boost::integral_constant::value> { }; namespace type_traits { template struct ice_and; template struct ice_and { static const bool value = false; }; template struct ice_not { static const bool value = true; }; } namespace detail { template< typename T > struct is_pointer_helper { static const bool value = false; }; template< typename T > struct is_pointer_impl { static const bool value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper::type>::value , ::boost::type_traits::ice_not< ::boost::is_member_pointer::value >::value >::value) ; }; } template< typename T > struct is_pointer : ::boost::integral_constant::value> { }; namespace mpl { template< bool C , typename T1 , typename T2 > struct if_c { }; template< typename T1 , typename T2 > struct if_c { typedef T2 type; }; } template struct enable_if_c { typedef T type; }; template class function; namespace detail { namespace function { union function_buffer { mutable void (*func_ptr)(); }; struct function_ptr_tag { }; template class get_function_tag { typedef typename mpl::if_c<(is_pointer::value), function_ptr_tag, function_ptr_tag>::type ptr_or_obj_tag; public: typedef ptr_or_obj_tag type; }; template struct functor_manager { public: static inline void manage(const function_buffer& in_buffer, function_buffer& out_buffer) { } }; struct vtable_base { void (*manager)(const function_buffer& in_buffer, function_buffer& out_buffer); }; } } class function_base { }; namespace detail { namespace function { template< typename FunctionObj, typename R , typename T0 > struct function_obj_invoker1 { static R invoke(function_buffer& function_obj_ptr , T0 a0) { } }; template< typename FunctionObj, typename R , typename T0 > struct void_function_obj_invoker1 { }; template< typename FunctionObj, typename R , typename T0 > struct get_function_obj_invoker1 { typedef typename mpl::if_c<(is_void::value), void_function_obj_invoker1< FunctionObj, R , T0 >, function_obj_invoker1< FunctionObj, R , T0 > >::type type; }; template struct get_invoker1 { template struct apply { typedef typename get_function_obj_invoker1< FunctionObj, R , T0 >::type invoker_type; typedef functor_manager manager_type; }; }; template struct basic_vtable1 { typedef R result_type; typedef result_type (*invoker_type)(function_buffer& , T0); vtable_base base; invoker_type invoker; }; } } template< typename R , typename T0 > class function1 : public function_base { typedef boost::detail::function::basic_vtable1< R , T0> vtable_type; public: template function1(Functor f ,typename enable_if_c< (boost::type_traits::ice_not< (is_integral::value)>::value), int>::type = 0 ) : function_base() { typedef typename detail::function::get_function_tag::type tag; typedef detail::function::get_invoker1 get_invoker; typedef typename get_invoker:: template apply handler_type; typedef typename handler_type::invoker_type invoker_type; typedef typename handler_type::manager_type manager_type; static vtable_type stored_vtable = { { &manager_type::manage } , &invoker_type::invoke }; } }; template class function : public function1 { typedef function1 base_type; public: template function(Functor f ,typename enable_if_c< (boost::type_traits::ice_not< (is_integral::value)>::value), int>::type = 0 ) : base_type(f) { } }; } typedef boost::function WarningHandler; class ParserImpl; class MyParser { ParserImpl* impl; public: MyParser (); }; class ParserImpl { public: ParserImpl (WarningHandler warner); }; static void DisplayWarning (const char* msg) { } MyParser::MyParser () { impl = new ParserImpl(DisplayWarning); }