From patchwork Wed Oct 26 22:20:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 122031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3172E1007D2 for ; Thu, 27 Oct 2011 09:20:45 +1100 (EST) Received: (qmail 15753 invoked by alias); 26 Oct 2011 22:20:43 -0000 Received: (qmail 15744 invoked by uid 22791); 26 Oct 2011 22:20:43 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Oct 2011 22:20:29 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p9QMKSoD017357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Oct 2011 22:20:28 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p9QMKRYv021963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Oct 2011 22:20:28 GMT Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p9QMKLJN016131; Wed, 26 Oct 2011 17:20:21 -0500 Received: from [192.168.1.4] (/79.51.11.135) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Oct 2011 15:20:21 -0700 Message-ID: <4EA8879F.40906@oracle.com> Date: Thu, 27 Oct 2011 00:20:15 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Jason Merrill CC: "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch / RFC] PR 50870 References: <4EA81BB4.8090900@oracle.com> <4EA826EA.4040900@redhat.com> <4EA82C27.3020700@oracle.com> <4EA8350D.8060907@redhat.com> In-Reply-To: <4EA8350D.8060907@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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);