re PR debug/14079 (wrong debug info for extern boolean variable in debug mode)
authorMatt Austern <austern@apple.com>
Mon, 8 Mar 2004 19:03:10 +0000 (19:03 +0000)
committerMatt Austern <austern@gcc.gnu.org>
Mon, 8 Mar 2004 19:03:10 +0000 (19:03 +0000)
PR debug/14079
* name-lookup.c (add_decl_to_level): Add extern variables, as well as static, to static_decls array.

From-SVN: r79122

gcc/cp/ChangeLog
gcc/cp/name-lookup.c

index ae6da109e6b45df763aef3fad8c196b760293fec..70f15ffd29897625a05577854f2afd936e5aaac7 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Matt Austern  <austern@apple.com>
+
+       PR debug/14079
+       * name-lookup.c (add_decl_to_level): Add extern variables, as well
+       as static, to static_decls array.
+       
 2004-03-05  Jason Merrill  <jason@redhat.com>
 
        * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
index 7d6239b67ed76f4abe6c456a3d4440e56eeb7aee..1da453a016dbf747da9274b025027a7d3a2e1531 100644 (file)
@@ -526,9 +526,13 @@ add_decl_to_level (tree decl, cxx_scope *b)
       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->kind == sk_namespace)
-       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);