]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR debug/14079 (wrong debug info for extern boolean variable in debug...
authorMatt Austern <austern@apple.com>
Wed, 17 Mar 2004 21:52:16 +0000 (21:52 +0000)
committerMatt Austern <austern@gcc.gnu.org>
Wed, 17 Mar 2004 21:52:16 +0000 (21:52 +0000)
Backport:
PR debug/14079
* decl.c (add_decl_to_level): Add extern variables, as well
as static, to static_decls array.

From-SVN: r79608

gcc/cp/ChangeLog
gcc/cp/decl.c

index 99f5d2193f36d91c06fb869fc1add1353dcd8b32..b3398a064604eaaf5f38712aa9e1f7fa9bba5d86 100644 (file)
@@ -1,3 +1,10 @@
+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:
index f9a8e9957d88f062d89e3f3420651ff9b9a465d8..902416d24df0a17183f715d69663c0abd42e0813 100644 (file)
@@ -1286,9 +1286,13 @@ add_decl_to_level (decl, 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->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);