doesn't match the begin SCOPE_STMT in partialness.
cp/
* semantics.c (do_pushlevel): Call pushlevel after adding the
SCOPE_STMT.
(do_poplevel): Call poplevel before adding the SCOPE_STMT.
* parse.y (function_body): Go back to using compstmt.
* decl.c (pushdecl): Skip another level to get to the parms level.
* call.c (build_new_method_call): Use is_dummy_object to determine
whether or not to evaluate the object parameter to a static member
function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60196
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-12-16 Jason Merrill <jason@redhat.com>
+
+ * c-semantics.c (add_scope_stmt): Abort if the end SCOPE_STMT
+ doesn't match the begin SCOPE_STMT in partialness.
+
2002-12-16 Geoffrey Keating <geoffk@apple.com>
* genmultilib: Create temporary files in unique subdirectory.
}
else
{
+ if (partial_p != SCOPE_PARTIAL_P (TREE_PURPOSE (top)))
+ abort ();
TREE_VALUE (top) = ss;
*stack_ptr = TREE_CHAIN (top);
}
+2002-12-16 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (do_pushlevel): Call pushlevel after adding the
+ SCOPE_STMT.
+ (do_poplevel): Call poplevel before adding the SCOPE_STMT.
+ * parse.y (function_body): Go back to using compstmt.
+ * decl.c (pushdecl): Skip another level to get to the parms level.
+
+ * call.c (build_new_method_call): Use is_dummy_object to determine
+ whether or not to evaluate the object parameter to a static member
+ function.
+
2002-12-14 Jason Merrill <jason@redhat.com>
* semantics.c (simplify_aggr_init_exprs_r): Also prepend the
call = build_over_call (cand, args, flags);
/* In an expression of the form `a->f()' where `f' turns out to
be a static member function, `a' is none-the-less evaluated. */
- if (instance && TREE_SIDE_EFFECTS (instance))
+ if (!is_dummy_object (instance_ptr) && TREE_SIDE_EFFECTS (instance))
call = build (COMPOUND_EXPR, TREE_TYPE (call), instance, call);
}
them there. */
struct cp_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)
{
;
/* 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. */
+ mem-initializer-list, so we open one there, too. */
function_body:
- 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);
+ begin_function_body_ ctor_initializer_opt compstmt
+ {
finish_function_body ($1);
}
;
{
tree scope_stmts = NULL_TREE;
- if (!processing_template_decl)
- scope_stmts = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
-
block = poplevel (kept_level_p (), 1, 0);
- if (block && !processing_template_decl)
+ if (!processing_template_decl)
{
- SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmts)) = block;
- SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmts)) = block;
+ /* This needs to come after the poplevel so that partial scopes
+ are properly nested. */
+ scope_stmts = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
+ if (block)
+ {
+ SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmts)) = block;
+ SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmts)) = block;
+ }
}
}
{
if (stmts_are_full_exprs_p ())
{
- pushlevel (0);
if (!processing_template_decl)
add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
+ pushlevel (0);
}
}