+2003-04-14 Mark Mitchell <mark@codesourcery.com>
+
+ * c-decl.c (grokdeclarator): Reject extern redeclarations of
+ static variables.
+
2003-04-14 Janis Johnson <janis287@us.ibm.com>
* config/rs6000/rs6000.md (define_constants): Define constants for
}
else if (type_quals)
type = c_build_qualified_type (type, type_quals);
-
+
+ /* It is invalid to create an `extern' declaration for a
+ variable if there is a global declaration that is
+ `static'. */
+ if (extern_ref && current_binding_level != global_binding_level)
+ {
+ tree global_decl;
+
+ global_decl = identifier_global_value (declarator);
+ if (global_decl
+ && TREE_CODE (global_decl) == VAR_DECL
+ && !TREE_PUBLIC (global_decl))
+ error ("variable previously declared `static' redeclared "
+ "`extern'");
+ }
+
decl = build_decl (VAR_DECL, declarator, type);
if (size_varies)
C_DECL_VARIABLE_SIZE (decl) = 1;
+2003-04-14 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.c-torture/execute/scope-2.c: Move to ...
+ * gcc.dg/noncompile/scope.c: .... here.
+
2003-04-14 Roger Sayle <roger@eyesopen.com>
* gcc.dg/20030414-2.c: New test case.