Commit a6d76a95 by Paolo Carlini Committed by Paolo Carlini

re PR c++/32108 (ICE with __label__ outside of block scope)

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: r127059
parent 5c24ddaf
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.
......
......@@ -1343,8 +1343,13 @@ finish_label_stmt (tree name)
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
// PR c++/32108
__label__ L; // { dg-error "function scopes" }
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