cp/
2007-07-30 Paolo Carlini <pcarlini@suse.de>
PR c++/32108
* semantics.c (finish_label_stmt): Reject the __label__
extension outside function scopes.
testsuite/
2007-07-30 Paolo Carlini <pcarlini@suse.de>
PR c++/32108
* g++.dg/ext/label6.C: New.
From-SVN: r127064
+2007-07-30 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/32108
+ * semantics.c (finish_label_stmt): Reject the __label__
+ extension outside function scopes.
+
2007-07-28 Simon Martin <simartin@users.sourceforge.net>
Mark Mitchell <mark@codesourcery.com>
void
finish_label_decl (tree name)
{
- tree decl = declare_local_label (name);
- add_decl_expr (decl);
+ if (!at_function_scope_p ())
+ {
+ error ("__label__ declarations are only allowed in function scopes");
+ return;
+ }
+
+ add_decl_expr (declare_local_label (name));
}
/* When DECL goes out of scope, make sure that CLEANUP is executed. */
+2007-07-30 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/32108
+ * g++.dg/ext/label6.C: New.
+
2007-07-28 Simon Martin <simartin@users.sourceforge.net>
PR c++/30917
--- /dev/null
+// PR c++/32108
+
+__label__ L; // { dg-error "function scopes" }