On 10/26/2011 06:27 PM, Jason Merrill wrote:
OK.
I re-opened this one because: 1- We may want to fix it in 4_6-branch too, it's a regression there too; 2- We are still handling incorrectly the template impl case. For the latter a variant of my old idea still works, fwiw.

Thanks,
Paolo.

/////////////////////
Index: pt.c
===================================================================
--- pt.c        (revision 180532)
+++ pt.c        (working copy)
@@ -13706,12 +13706,13 @@ tsubst_copy_and_build (tree t,
        /* Remember that there was a reference to this entity.  */
        if (DECL_P (object))
          mark_used (object);
-       object_type = TREE_TYPE (object);
+       object_type = (TREE_CODE (object) == ARROW_EXPR
+                      ? TREE_OPERAND (object, 0) : TREE_TYPE (object));
 
        member = TREE_OPERAND (t, 1);
        if (BASELINK_P (member))
          member = tsubst_baselink (member,
-                                   non_reference (TREE_TYPE (object)),
+                                   non_reference (object_type),
                                    args, complain, in_decl);
        else
          member = tsubst_copy (member, args, complain, in_decl);

Reply via email to