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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127059
138bc75d-0d04-0410-961f-
82ee72b054a4
+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-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* parser.c (eof_token): Un-constify.
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-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32858
--- /dev/null
+// PR c++/32108
+
+__label__ L; // { dg-error "function scopes" }