summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorsimartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-06 21:58:50 +0000
committersimartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-06 21:58:50 +0000
commit0a4efe822fbfe420fb7a7a731238f3bade15bd3c (patch)
treea3af35a9778f3dd10514c305f40f52ad48c7cfda /gcc/c-decl.c
parent9f4a50a7518f093ef8a30e05705b7286de109622 (diff)
downloadgcc-0a4efe822fbfe420fb7a7a731238f3bade15bd3c.tar.gz
gcc/
2010-11-16 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. gcc/testsuite/ 2010-11-16 Simon Martin <simartin@users.sourceforge.net> PR c/43384 * gcc.dg/parser-error-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 7d27dfe8f0f..e1f14029b80 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3013,7 +3013,7 @@ lookup_label (tree name)
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;
@@ -7847,6 +7847,9 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
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),