* c-common.c (finish_label_address_expr): Handle the
error_mark_node.
PR c++/10278
* g++.dg/parse/crash2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65116
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
* real.c (real_identical): Reorg so as to not compare
return case_label;
}
-/* Finish an expression taking the address of LABEL. Returns an
- expression for the address. */
+/* Finish an expression taking the address of LABEL (an
+ IDENTIFIER_NODE). Returns an expression for the address. */
tree
finish_label_address_expr (label)
pedwarn ("ISO C forbids taking the address of a label");
}
+ if (label == error_mark_node)
+ return error_mark_node;
+
label = lookup_label (label);
if (label == NULL_TREE)
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>
* gcc.c-torture/compile/20030331-1.c: New test, moved from...
--- /dev/null
+/* { dg-do compile } */
+int main(void)
+{
+ char x, y;
+ if ('A' == x) && ('B' == y)) { } /* { dg-error "" } */
+ if (x == 'A') && (y == 'B')) { } /* { dg-error "" } */
+}