diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-03-18 18:58:08 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-03-18 18:58:08 +0000 |
commit | 4ada538bd6381192f941d50068463fcf84775d76 (patch) | |
tree | 04de0b96dfb183513bec30c4171b9fce14927dd4 /gcc/c-decl.c | |
parent | 79e9ebdc7db0be1cd866c3ab3d219053b46835d8 (diff) | |
download | gcc-4ada538bd6381192f941d50068463fcf84775d76.zip gcc-4ada538bd6381192f941d50068463fcf84775d76.tar.gz gcc-4ada538bd6381192f941d50068463fcf84775d76.tar.bz2 |
c-decl.c (grokdeclarator): Do not complain about redeclaring visible "static" identifiers "extern" in a...
* c-decl.c (grokdeclarator): Do not complain about redeclaring
visible "static" identifiers "extern" in a local scope.
* dwarf2out.c (loc_descriptor_from_tree): Handle pre- and
post-increments/decrements.
* gcc.dg/local1.c: New test.
* gcc.dg/debug/dwarf2/c99-typedef1.c: New test.
From-SVN: r79634
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e59789b..9589d54 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4416,7 +4416,7 @@ grokdeclarator (tree declarator, tree declspecs, /* It is invalid to create an `extern' declaration for a variable if there is a global declaration that is - `static'. */ + `static' and the global declaration is not visible. */ if (extern_ref && current_scope != global_scope) { tree global_decl; @@ -4424,6 +4424,7 @@ grokdeclarator (tree declarator, tree declspecs, global_decl = identifier_global_value (declarator); if (global_decl && TREE_CODE (global_decl) == VAR_DECL + && lookup_name (declarator) != global_decl && !TREE_PUBLIC (global_decl)) error ("variable previously declared `static' redeclared " "`extern'"); |