aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-06-11 17:02:13 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-06-11 17:02:13 +0000
commita5512a2fe24bd5e4d3ce499a4c6deca0a94042e3 (patch)
tree23fd100d83ba03cedc1c63d77eeaf018012cddbf
parentc0081c100c88036f8c3914f049bfa087783cc277 (diff)
downloadgcc-a5512a2fe24bd5e4d3ce499a4c6deca0a94042e3.zip
gcc-a5512a2fe24bd5e4d3ce499a4c6deca0a94042e3.tar.gz
gcc-a5512a2fe24bd5e4d3ce499a4c6deca0a94042e3.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/tree.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a6e4e03..0f79c7c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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>
PR c++/10968
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b696c3b..2e907c0 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;