re PR c++/21123 (ICE in cp_expr_size, at cp/cp-objcp-common.c:101)

PR c++/21123
        * cp/method.c (use_thunk): Use build_cplus_new instead of
        force_target_expr.

        * tree.h (CALL_FROM_THUNK_P): Add CALL_EXPR_CHECK.

From-SVN: r106634
This commit is contained in:
Jason Merrill 2005-11-08 03:32:26 -05:00 committed by Jason Merrill
parent dfea1f6121
commit 831d8bd741
5 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2005-11-08 Jason Merrill <jason@redhat.com>
* tree.h (CALL_FROM_THUNK_P): Add CALL_EXPR_CHECK.
2005-11-08 Uros Bizjak <uros@kss-loka.si>
PR target/19340

View File

@ -1,3 +1,9 @@
2005-11-08 Jason Merrill <jason@redhat.com>
PR c++/21123
* method.c (use_thunk): Use build_cplus_new instead of
force_target_expr.
2005-11-06 Jason Merrill <jason@redhat.com>
James A. Morrison <phython@gcc.gnu.org>

View File

@ -502,7 +502,8 @@ use_thunk (tree thunk_fndecl, bool emit_p)
t = build3 (COND_EXPR, TREE_TYPE (t), cond, t,
cp_convert (TREE_TYPE (t), integer_zero_node));
}
t = force_target_expr (TREE_TYPE (t), t);
if (IS_AGGR_TYPE (TREE_TYPE (t)))
t = build_cplus_new (TREE_TYPE (t), t);
finish_return_stmt (t);
}

View File

@ -0,0 +1,23 @@
// PR c++/21123
struct A
{
A( const A &a);
const A& operator=( const A& a);
};
struct B
{
virtual A f();
};
struct C : virtual B
{
virtual A f();
A a;
};
A C::f()
{
return a;
}

View File

@ -1023,7 +1023,7 @@ extern void tree_operand_check_failed (int, enum tree_code,
/* In a CALL_EXPR, means that the call is the jump from a thunk to the
thunked-to function. */
#define CALL_FROM_THUNK_P(NODE) ((NODE)->common.protected_flag)
#define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->common.protected_flag)
/* In a type, nonzero means that all objects of the type are guaranteed by the
language or front-end to be properly aligned, so we can indicate that a MEM