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

PR c++/21123
        * cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference
        parms in a thunk.

From-SVN: r107738
This commit is contained in:
Jason Merrill 2005-11-30 15:58:27 -05:00 committed by Jason Merrill
parent d090221b94
commit 5b009a9670
3 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-11-30 Jason Merrill <jason@redhat.com>
PR c++/21123
* cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference
parms in a thunk.
2005-11-30 Ben Elliston <bje@au.ibm.com>
* typeck.c (build_x_unary_op): Correct spelling in error message.

View File

@ -596,7 +596,10 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
tree stmt = *stmt_p;
struct pointer_set_t *p_set = (struct pointer_set_t*) data;
if (is_invisiref_parm (stmt))
if (is_invisiref_parm (stmt)
/* Don't dereference parms in a thunk, pass the references through. */
&& !(DECL_THUNK_P (current_function_decl)
&& TREE_CODE (stmt) == PARM_DECL))
{
*stmt_p = convert_from_reference (stmt);
*walk_subtrees = 0;

View File

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