From 3704ef744f0b39b4c28d84bef7702644b62ccefb Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 20 Feb 2002 23:10:36 +0000 Subject: [PATCH] c-decl.c (pushdecl): If no global declaration is found for an extern declaration in block scope... * c-decl.c (pushdecl): If no global declaration is found for an extern declaration in block scope, try a limbo one. From-SVN: r49917 --- gcc/ChangeLog | 5 +++++ gcc/c-decl.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59d8288a77a..9538ca24128 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-02-20 Alexandre Oliva + + * c-decl.c (pushdecl): If no global declaration is found for an + extern declaration in block scope, try a limbo one. + 2002-02-20 Jakub Jelinek PR c++/4401 diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6e7c3ca78c0..23c37ef8d93 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2199,11 +2199,13 @@ pushdecl (x) not errors. X11 for instance depends on this. */ if (! t && DECL_EXTERNAL (x) && TREE_PUBLIC (x) && ! flag_traditional) { - t = lookup_name (name); + t = IDENTIFIER_GLOBAL_VALUE (name); /* Type decls at global scope don't conflict with externs declared inside lexical blocks. */ - if (t && TREE_CODE (t) == TYPE_DECL) - t = 0; + if (! t || TREE_CODE (t) == TYPE_DECL) + /* If there's no visible global declaration, try for an + invisible one. */ + t = IDENTIFIER_LIMBO_VALUE (name); different_binding_level = 1; } if (t != 0 && t == error_mark_node) -- 2.30.2