+2001-03-28 Richard Henderson <rth@redhat.com>
+
+ * decl.c (struct named_label_list): Rename eh_region to
+ in_try_scope, add in_catch_scope.
+ (struct binding_level): Rename eh_region to is_try_scope,
+ add is_catch_scope.
+ (note_level_for_try): Rename from note_level_for_eh.
+ (note_level_for_catch): New.
+ (poplevel): Copy both is_try_scope and is_catch_scope to
+ the named_label_list struct.
+ (check_previous_goto_1): Don't check for catch block via
+ DECL_ARTIFICIAL; use in_try_scope instead.
+ (check_goto): Likewise.
+ * cp-tree.h (note_level_for_try, note_level_for_catch): Declare.
+ * except.c (expand_start_catch_block): Call note_level_for_catch.
+ * semantics.c (begin_compound_stmt): Update for note_level_for_try.
+
2001-03-27 Richard Henderson <rth@redhat.com>
* except.c: Use USING_SJLJ_EXCEPTIONS instead of
* except.c: Don't include it.
2001-03-22 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
- based on an idea from Joe Buck <jbuck@synopsys.com>
+ based on an idea from Joe Buck <jbuck@synopsys.com>
* parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore):
New nonterminals.
2001-01-16 Daniel Berlin <dberlin@redhat.com>
- * cvt.c (ocp_convert): Handle vector type conversion
- * typeck2.c (digest_init): Handle vector type initializations
+ * cvt.c (ocp_convert): Handle vector type conversion
+ * typeck2.c (digest_init): Handle vector type initializations
2001-01-16 Phil Edwards <pme@sources.redhat.com>
2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk>
- * cp/decl2.c (cxx_post_options): Call cpp_post_options.
+ * cp/decl2.c (cxx_post_options): Call cpp_post_options.
2001-01-05 Nathan Sidwell <nathan@codesourcery.com>
tree old_value;
tree label_decl;
tree bad_decls;
- int eh_region;
struct named_label_list *next;
+ unsigned int in_try_scope : 1;
+ unsigned int in_catch_scope : 1;
};
#define named_labels cp_function_chain->x_named_labels
worry about ambiguous (ARM or ISO) scope rules. */
unsigned is_for_scope : 1;
- /* True if this level corresponds to an EH region, as for a try block.
- Currently this information is only available while building the
- tree structure. */
- unsigned eh_region : 1;
+ /* True if this level corresponds to a TRY block. Currently this
+ information is only available while building the tree structure. */
+ unsigned is_try_scope : 1;
- /* Four bits left for this word. */
+ /* True if this level corresponds to a CATCH block. Currently this
+ information is only available while building the tree structure. */
+ unsigned is_catch_scope : 1;
+
+ /* Three bits left for this word. */
#if defined(DEBUG_CP_BINDING_LEVELS)
/* Binding depth at which this level began. */
/* Record that the current binding level represents a try block. */
void
-note_level_for_eh ()
+note_level_for_try ()
{
- current_binding_level->eh_region = 1;
+ current_binding_level->is_try_scope = 1;
+}
+
+/* Record that the current binding level represents a catch block. */
+
+void
+note_level_for_catch ()
+{
+ current_binding_level->is_catch_scope = 1;
}
/* For a binding between a name and an entity at a block scope,
if (labels->binding_level == current_binding_level)
{
tree decl;
- if (current_binding_level->eh_region)
- labels->eh_region = 1;
+ if (current_binding_level->is_try_scope)
+ labels->in_try_scope = 1;
+ if (current_binding_level->is_catch_scope)
+ labels->in_catch_scope = 1;
for (decl = labels->names_in_scope; decl;
decl = TREE_CHAIN (decl))
if (decl_jump_unsafe (decl))
identified = 1;
}
- if (problem > 1 && DECL_ARTIFICIAL (new_decls))
- /* Can't skip init of __exception_info. */
- cp_error_at (" enters catch block", new_decls);
- else if (problem > 1)
+ if (problem > 1)
cp_error_at (" crosses initialization of `%#D'",
new_decls);
else
if (b == level)
break;
- if (b->eh_region && ! saw_eh)
+ if ((b->is_try_scope || b->is_catch_scope) && ! saw_eh)
{
if (! identified)
{
pedwarn_with_file_and_line (file, line, " from here");
identified = 1;
}
- error (" enters try block");
+ if (b->is_try_scope)
+ error (" enters try block");
+ else
+ error (" enters catch block");
saw_eh = 1;
}
}
if (lab == 0)
return;
- if ((lab->eh_region || lab->bad_decls) && !identified)
+ if ((lab->in_try_scope || lab->in_catch_scope || lab->bad_decls)
+ && !identified)
{
cp_pedwarn_at ("jump to label `%D'", decl);
pedwarn (" from here");
cp_pedwarn_at (" enters scope of non-POD `%#D'", b);
}
- if (lab->eh_region)
+ if (lab->in_try_scope)
error (" enters try block");
+ else if (lab->in_catch_scope)
+ error (" enters catch block");
}
/* Define a label, specifying the location in the source file.