From 14f3e886335f8588e7387f4bc1b6f35719f9f1bb Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sun, 8 Nov 1992 02:48:04 +0000 Subject: [PATCH] (finish_decl): Don't clear DECL_INITIAL in inline fn decls. From-SVN: r2716 --- gcc/c-decl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 40f30d32401..2290bffd18c 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3335,11 +3335,16 @@ finish_decl (decl, init, asmspec_tree) 0); } - if (temporary && TREE_PERMANENT (decl)) + /* ??? After 2.3, test (init != 0) instead of TREE_CODE. */ + if (!(TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) + && temporary && TREE_PERMANENT (decl)) { /* We need to remember that this array HAD an initialization, but discard the actual temporary nodes, since we can't have a permanent node keep pointing to them. */ + /* We make an exception for inline functions, since it's + normal for a local extern redeclaration of an inline function + to have a copy of the top-level decl's DECL_INLINE. */ if (DECL_INITIAL (decl) != 0) DECL_INITIAL (decl) = error_mark_node; } -- 2.30.2