curly braces.
* decl.c (pushdecl): Don't try to skip it.
(begin_function_body): Keep the block we create, not the next one.
* init.c (emit_base_init): Don't mess with keep_next_level.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49076
138bc75d-0d04-0410-961f-
82ee72b054a4
2002-01-22 Jason Merrill <jason@redhat.com>
+ * parse.y (function_body): Suppress the block for the outermost
+ curly braces.
+ * decl.c (pushdecl): Don't try to skip it.
+ (begin_function_body): Keep the block we create, not the next one.
+ * init.c (emit_base_init): Don't mess with keep_next_level.
+
* class.c (build_base_path): Tweak formatting.
2002-01-19 Nathan Sidwell <nathan@codesourcery.com>
them there. */
struct binding_level *b = current_binding_level->level_chain;
- /* Skip the ctor/dtor cleanup level. */
- b = b->level_chain;
-
/* ARM $8.3 */
if (b->parm_flag == 1)
{
{
tree stmt;
+ if (processing_template_decl)
+ /* Do nothing now. */;
+ else
+ /* Always keep the BLOCK node associated with the outermost pair of
+ curly braces of a function. These are needed for correct
+ operation of dwarfout.c. */
+ keep_next_level (1);
+
stmt = begin_compound_stmt (0);
COMPOUND_STMT_BODY_BLOCK (stmt) = 1;
else if (DECL_DESTRUCTOR_P (current_function_decl))
begin_destructor_body ();
- /* Always keep the BLOCK node associated with the outermost pair of
- curly braces of a function. These are needed for correct
- operation of dwarfout.c. */
- keep_next_level (1);
-
return stmt;
}
int i;
int n_baseclasses = BINFO_N_BASETYPES (t_binfo);
- /* We did a keep_next_level (1) in begin_function_body. We don't want
- that to apply to any blocks generated for member initializers, so
- clear it out. */
- keep_next_level (0);
-
mem_init_list = sort_member_init (t, mem_init_list);
sort_base_init (t, base_init_list, &rbase_init_list, &vbase_init_list);
perform_member_init (member, init, from_init_list);
mem_init_list = TREE_CHAIN (mem_init_list);
}
-
- /* And restore it. */
- keep_next_level (1);
}
/* Returns the address of the vtable (i.e., the value that should be
| END_OF_SAVED_INPUT
;
+/* The outermost block of a function really begins before the
+ mem-initializer-list, so we open one there and suppress the one that
+ actually corresponds to the curly braces. */
function_body:
- .begin_function_body ctor_initializer_opt compstmt
- {
+ .begin_function_body ctor_initializer_opt save_lineno '{'
+ { $<ttype>$ = begin_compound_stmt (/*has_no_scope=*/1); }
+ compstmtend
+ {
+ STMT_LINENO ($<ttype>5) = $3;
+ finish_compound_stmt (/*has_no_scope=*/1, $<ttype>5);
finish_function_body ($1);
}
;