Commit a5512a2f by Mark Mitchell Committed by Mark Mitchell

re PR c++/11131 (Unrelated declaration removes inline flag from function)

	PR c++/11131
	* tree.c (cp_cannot_inline_fn): Check for "inline" before
	instantiation.

From-SVN: r67783
parent c0081c10
2003-06-11 Mark Mitchell <mark@codesourcery.com>
PR c++/11131
* tree.c (cp_cannot_inline_fn): Check for "inline" before
instantiation.
2003-06-10 Jason Merrill <jason@redhat.com> 2003-06-10 Jason Merrill <jason@redhat.com>
PR c++/10968 PR c++/10968
......
...@@ -2209,14 +2209,16 @@ cp_cannot_inline_tree_fn (fnp) ...@@ -2209,14 +2209,16 @@ cp_cannot_inline_tree_fn (fnp)
if (DECL_TEMPLATE_INFO (fn) if (DECL_TEMPLATE_INFO (fn)
&& TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn))) && TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn)))
{ {
/* Don't instantiate functions that are not going to be
inlined. */
if (!DECL_INLINE (DECL_TEMPLATE_RESULT
(template_for_substitution (fn))))
return 1;
fn = *fnp = instantiate_decl (fn, /*defer_ok=*/0); fn = *fnp = instantiate_decl (fn, /*defer_ok=*/0);
if (TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn))) if (TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn)))
return 1; return 1;
} }
if (!DECL_INLINE (fn))
return 1;
if (flag_really_no_inline if (flag_really_no_inline
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment