Commit 6b665219 by Mark Mitchell Committed by Mark Mitchell

re PR c++/10278 (ICE in parser)

	PR c++/10278
	* c-common.c (finish_label_address_expr): Handle the
	error_mark_node.

	PR c++/10278
	* g++.dg/parse/crash2.C: New test.

From-SVN: r65116
parent b174e2d4
2003-03-31 Mark Mitchell <mark@codesourcery.com>
PR c++/10278
* c-common.c (finish_label_address_expr): Handle the
error_mark_node.
2003-03-31 Richard Henderson <rth@redhat.com> 2003-03-31 Richard Henderson <rth@redhat.com>
* real.c (real_identical): Reorg so as to not compare * real.c (real_identical): Reorg so as to not compare
......
...@@ -4212,8 +4212,8 @@ c_add_case_label (cases, cond, low_value, high_value) ...@@ -4212,8 +4212,8 @@ c_add_case_label (cases, cond, low_value, high_value)
return case_label; return case_label;
} }
/* Finish an expression taking the address of LABEL. Returns an /* Finish an expression taking the address of LABEL (an
expression for the address. */ IDENTIFIER_NODE). Returns an expression for the address. */
tree tree
finish_label_address_expr (label) finish_label_address_expr (label)
...@@ -4229,6 +4229,9 @@ finish_label_address_expr (label) ...@@ -4229,6 +4229,9 @@ finish_label_address_expr (label)
pedwarn ("ISO C forbids taking the address of a label"); pedwarn ("ISO C forbids taking the address of a label");
} }
if (label == error_mark_node)
return error_mark_node;
label = lookup_label (label); label = lookup_label (label);
if (label == NULL_TREE) if (label == NULL_TREE)
result = null_pointer_node; result = null_pointer_node;
......
2003-03-31 Mark Mitchell <mark@codesourcery.com>
PR c++/10278
* g++.dg/parse/crash2.C: New test.
2003-03-31 Richard Sandiford <rsandifo@redhat.com> 2003-03-31 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/compile/20030331-1.c: New test, moved from... * gcc.c-torture/compile/20030331-1.c: New test, moved from...
......
/* { dg-do compile } */
int main(void)
{
char x, y;
if ('A' == x) && ('B' == y)) { } /* { dg-error "" } */
if (x == 'A') && (y == 'B')) { } /* { dg-error "" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment