From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27368 invoked by alias); 4 Nov 2008 16:05:14 -0000 Received: (qmail 17961 invoked by uid 48); 4 Nov 2008 16:03:44 -0000 Date: Tue, 04 Nov 2008 16:05:00 -0000 Message-ID: <20081104160344.17960.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/36631] [4.3/4.4 Regression] attribute always_inline -> sorry, unimplemented: recursive inlining In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" 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 X-SW-Source: 2008-11/txt/msg00287.txt.bz2 ------- Comment #8 from jakub at gcc dot gnu dot org 2008-11-04 16:03 ------- Actually, looking at this some more, the problem is just that g has a wrong DECL_ARG_TYPE. When instantiate_class_template is called on B, it instantiates g; class C is returned by lookup_template_class, but not yet a complete type, so it doesn't have TYPE_HAS_INIT_REF set, nor TYPE_HAS_COMPLEX_INIT_REF, nor TREE_ADDRESSABLE. Then tsubst_decl : if (!DECL_TEMPLATE_PARM_P (r)) DECL_ARG_TYPE (r) = type_passed_as (type); is called, but the RECORD_TYPE C is still incomplete at this point, so type_passed_as, seeing no TREE_ADDRESSABLE being set on type, returns type itself. Afterwards when require_complete_types_for_parms is called on trigger's parameters, instantiate_class_template is called on C and all the above mentioned 3 bits are set. But nothing goes back to fix up DECL_ARG_TYPE, at least not until instantiate_pending_templates eventually calls require_complete_types_for_parms on g's params. But that is already way after trigger has been gimplified. So I believe we need to update DECL_ARG_TYPE (parm) from type_passed_as (TREE_TYPE (parm)) for calls a function is making, but am not sure where would that be best done. In genericization? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36631