+2006-06-29 Lee Millward <lee.millward@gmail.com>
+ Andrew Pinski <pinskia@gmail.com>
+
+ PR c++/27820
+ * decl.c (define_label): Return error_mark_node on error.
+ * semantics.c (finish_label_stmt): Don't call
+ add_stmt for invalid labels.
+
2006-07-06 Jason Merrill <jason@redhat.com>
PR c++/28279
pedwarn ("label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
- error ("duplicate label %qD", decl);
+ {
+ error ("duplicate label %qD", decl);
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
+ }
else
{
struct named_label_use_entry *use;
finish_label_stmt (tree name)
{
tree decl = define_label (input_location, name);
+
+ if (decl == error_mark_node)
+ return error_mark_node;
+
return add_stmt (build_stmt (LABEL_EXPR, decl));
}
+2006-07-07 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/27820
+ * g++.dg/other/label1.C: New test.
+
2006-07-07 Richard Guenther <rguenther@suse.de>
PR middle-end/28268
--- /dev/null
+//PR c++/27820
+
+void foo()
+{
+ L: L: ; // { dg-error "duplicate label" }
+}
+