diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 5121acd..7016ecb 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2013-11-29 Joseph Myers <joseph@codesourcery.com> + + PR c/57574 + * c-decl.c (merge_decls): Clear DECL_EXTERNAL for a definition of + an inline function following a static declaration. + 2013-11-28 Jakub Jelinek <jakub@redhat.com> PR c/59310 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index c019a3e..27be7fc 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -2343,6 +2343,14 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) && !current_function_decl) DECL_EXTERNAL (newdecl) = 0; + /* An inline definition following a static declaration is not + DECL_EXTERNAL. */ + if (new_is_definition + && (DECL_DECLARED_INLINE_P (newdecl) + || DECL_DECLARED_INLINE_P (olddecl)) + && !TREE_PUBLIC (olddecl)) + DECL_EXTERNAL (newdecl) = 0; + if (DECL_EXTERNAL (newdecl)) { TREE_STATIC (newdecl) = TREE_STATIC (olddecl); |