diff options
author | Richard Stallman <rms@gnu.org> | 1992-11-08 02:48:04 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-11-08 02:48:04 +0000 |
commit | 14f3e886335f8588e7387f4bc1b6f35719f9f1bb (patch) | |
tree | b5edd37742eb38ab2de55fbac69679447ef45f3f /gcc | |
parent | b9248bdb2724e1446d958e14a8d663a21a351aa0 (diff) | |
download | gcc-14f3e886335f8588e7387f4bc1b6f35719f9f1bb.zip gcc-14f3e886335f8588e7387f4bc1b6f35719f9f1bb.tar.gz gcc-14f3e886335f8588e7387f4bc1b6f35719f9f1bb.tar.bz2 |
(finish_decl): Don't clear DECL_INITIAL in inline fn decls.
From-SVN: r2716
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-decl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 40f30d3..2290bff 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; } |