+2004-01-30 Richard Henderson <rth@redhat.com>
+
+ PR c++/13693
+ * method.c (use_thunk): Don't force_target_expr for void thunks.
+ * tree.c (build_target_expr_with_type): Assert non-void type.
+ (force_target_expr): Likewise.
+
2004-01-30 Michael Matz <matz@suse.de>
* parser.c (cp_parser_labeled_statement): Accept case ranges.
t = tree_cons (NULL_TREE, a, t);
t = nreverse (t);
t = build_call (alias, t);
- t = force_target_expr (TREE_TYPE (t), t);
- if (!this_adjusting)
- t = thunk_adjust (t, /*this_adjusting=*/0,
- fixed_offset, virtual_offset);
if (VOID_TYPE_P (TREE_TYPE (t)))
finish_expr_stmt (t);
else
- finish_return_stmt (t);
+ {
+ t = force_target_expr (TREE_TYPE (t), t);
+ if (!this_adjusting)
+ t = thunk_adjust (t, /*this_adjusting=*/0,
+ fixed_offset, virtual_offset);
+ finish_return_stmt (t);
+ }
/* Since we want to emit the thunk, we explicitly mark its name as
referenced. */
{
tree slot;
+ my_friendly_assert (!VOID_TYPE_P (type), 20040130);
+
if (TREE_CODE (init) == TARGET_EXPR)
return init;
else if (CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)
tree
force_target_expr (tree type, tree init)
{
- tree slot = build_local_temp (type);
+ tree slot;
+
+ my_friendly_assert (!VOID_TYPE_P (type), 20040130);
+
+ slot = build_local_temp (type);
return build_target_expr (slot, init);
}