+2003-03-17 Matt Austern <austern@apple.com>
+
+ Backport:
+ PR debug/14079
+ * decl.c (add_decl_to_level): Add extern variables, as well
+ as static, to static_decls array.
+
2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
Backport:
b->names = decl;
b->names_size++;
- /* If appropriate, add decl to separate list of statics */
+ /* If appropriate, add decl to separate list of statics. We
+ include extern variables because they might turn out to be
+ static later. It's OK for this list to contain a few false
+ positives. */
if (b->namespace_p)
- if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
+ if ((TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL
&& (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl))))
VARRAY_PUSH_TREE (b->static_decls, decl);