* cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference
parms in a thunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107738
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
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;
--- /dev/null
+// 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;
+}