summaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-11 17:02:13 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-11 17:02:13 +0000
commit15273bcd399fabc5409c2028f5fd4edef8d5955d (patch)
tree23fd100d83ba03cedc1c63d77eeaf018012cddbf /gcc/cp/tree.c
parentbfd7362dba1866334d3ff14f93412ecd2fa6b528 (diff)
downloadgcc-15273bcd399fabc5409c2028f5fd4edef8d5955d.tar.gz
PR c++/11131
* tree.c (cp_cannot_inline_fn): Check for "inline" before instantiation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67783 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b696c3bd655..2e907c0b837 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2209,14 +2209,16 @@ cp_cannot_inline_tree_fn (fnp)
if (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);
if (TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn)))
return 1;
}
- if (!DECL_INLINE (fn))
- return 1;
-
if (flag_really_no_inline
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
return 1;