+2010-11-06 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c/43384
+ * c-decl.c (lookup_label): Labels can only be referenced in a
+ function's scope.
+ (store_parm_decls_oldstyle): Skip erroneous parameters.
+
2010-11-06 Anatoly Sokolov <aesok@post.ru>
* config/fr30/fr30.h (FUNCTION_VALUE_REGNO_P, FUNCTION_VALUE,
tree label;
struct c_label_vars *label_vars;
- if (current_function_decl == 0)
+ if (current_function_scope == 0)
{
error ("label %qE referenced outside of any function", name);
return 0;
if (b && B_IN_CURRENT_SCOPE (b))
{
decl = b->decl;
+ /* Skip erroneous parameters. */
+ if (decl == error_mark_node)
+ continue;
/* If we got something other than a PARM_DECL it is an error. */
if (TREE_CODE (decl) != PARM_DECL)
error_at (DECL_SOURCE_LOCATION (decl),
+2010-11-06 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c/43384
+ * gcc.dg/parser-error-3.c: New test.
+
2010-11-06 Nathan Froyd <froydnj@codesourcery.com>
PR c++/45332
--- /dev/null
+/* PR c/43384 */
+/* { dg-do "compile" } */
+
+void c_direct(par)
+ void *par = &&lab; /* { dg-error "is initialized|non-standard|outside of" } */
+{}
+
+void foo(p, q)
+ int *p = &q; /* { dg-error "initialized|undeclared" } */
+{}
+
+void bar(i)
+ int j = i; /* { dg-error "initialized|undeclared|no such parameter" } */
+{}