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
This commit is contained in:
parent
5c24ddaf36
commit
a6d76a9544
@ -1,3 +1,9 @@
|
||||
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. */
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
3
gcc/testsuite/g++.dg/ext/label6.C
Normal file
3
gcc/testsuite/g++.dg/ext/label6.C
Normal file
@ -0,0 +1,3 @@
|
||||
// PR c++/32108
|
||||
|
||||
__label__ L; // { dg-error "function scopes" }
|
Loading…
Reference in New Issue
Block a user