Commit e3b776dc by Richard Kenner

(finish_decl): TREE_ASM_WRITTEN says if duplicate_decls modified declaration to...

(finish_decl): TREE_ASM_WRITTEN says if duplicate_decls modified
declaration to match an outside file scope declaration.

From-SVN: r11264
parent f6135b20
...@@ -3734,10 +3734,11 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3734,10 +3734,11 @@ finish_decl (decl, init, asmspec_tree)
Also if it is not file scope. Also if it is not file scope.
Otherwise, let it through, but if it is not `extern' Otherwise, let it through, but if it is not `extern'
then it may cause an error message later. */ then it may cause an error message later. */
/* We must use DECL_CONTEXT instead of current_binding_level, /* A duplicate_decls call could have changed an extern
because a duplicate_decls call could have changed the binding declaration into a file scope one. This can be detected
level of this decl. */ by TREE_ASM_WRITTEN being set. */
(DECL_INITIAL (decl) != 0 || DECL_CONTEXT (decl) != 0) (DECL_INITIAL (decl) != 0
|| DECL_CONTEXT (decl) != 0 && ! TREE_ASM_WRITTEN (decl))
: :
/* An automatic variable with an incomplete type /* An automatic variable with an incomplete type
is an error. */ is an error. */
...@@ -3779,7 +3780,9 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3779,7 +3780,9 @@ finish_decl (decl, init, asmspec_tree)
end_temporary_allocation (); end_temporary_allocation ();
/* This is a no-op in c-lang.c or something real in objc-actions.c. */ /* This is a no-op in c-lang.c or something real in objc-actions.c. */
maybe_objc_check_decl (decl); maybe_objc_check_decl (decl);
rest_of_decl_compilation (decl, asmspec, DECL_CONTEXT (decl) == 0, rest_of_decl_compilation (decl, asmspec,
(DECL_CONTEXT (decl) == 0
|| TREE_ASM_WRITTEN (decl)),
0); 0);
pop_obstacks (); pop_obstacks ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment