From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22023 invoked by alias); 11 Feb 2015 19:10:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21981 invoked by uid 89); 11 Feb 2015 19:10:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 11 Feb 2015 19:10:33 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t1BJAVAP014712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Feb 2015 19:10:31 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id t1BJAUoH016437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 11 Feb 2015 19:10:30 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t1BJAUXt003113; Wed, 11 Feb 2015 19:10:30 GMT Received: from [192.168.1.4] (/79.46.5.50) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 11 Feb 2015 11:10:29 -0800 Message-ID: <54DBA923.6060602@oracle.com> Date: Wed, 11 Feb 2015 19:10:00 -0000 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jason Merrill , =?windows-1252?Q?Fabien_Ch=EAne?= CC: GCC Patches Subject: Re: C++ Patch for c++/60894 References: <54233484.8050801@redhat.com> <5434576D.6080004@redhat.com> <54368EF6.8050401@redhat.com> <547CD6BC.9060501@redhat.com> In-Reply-To: <547CD6BC.9060501@redhat.com> Content-Type: multipart/mixed; boundary="------------010605000703050501090504" X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00739.txt.bz2 This is a multi-part message in MIME format. --------------010605000703050501090504 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-length: 1496 Hi, On 12/01/2014 09:59 PM, Jason Merrill wrote: > On 12/01/2014 07:01 AM, Fabien ChĂȘne wrote: >> 2014-11-03 21:18 GMT+01:00 Fabien ChĂȘne : >>> 2014-10-09 15:34 GMT+02:00 Jason Merrill : >>> [...] >>>>> If the USING_DECL is returned, the code below will be rejected as >>>>> expected, but the error message will not mention the line where the >>>>> USING_DECL appears as the previous definition, but at the target >>>>> declaration of the USING_DECL instead. >>>> >>>> >>>> I think that's what happens if you strip the USING_DECL and return >>>> what it >>>> points to; if you return the USING_DECL itself that shouldn't >>>> happen (though >>>> then the caller needs to be able to deal with getting a USING_DECL). >>> >>> [Sorry for the delay] Humm, l_a_c_t returns a TYPE upon success, shall >>> I change it and return a DECL instead ? >> >> Ping. Before I made the change, I'd like to be sure this is what you >> have in mind. > > I think that makes sense. Today I was having a look to this pending issue and went astray due to the broken thread: I wondered if, basing on Fabien' first try and the comments accompanying tag_scope, it would make sense to use strip_using_decl only when the scope is ts_global (or maybe != ts_current)?!? The below certainly passes testing. Unless of course Fabien has the above implemented and ready (I don't, I miss the correct changes to the lookup_and_check_tag callers) Thanks, Paolo. ///////////////// --------------010605000703050501090504 Content-Type: text/plain; charset=UTF-8; name="p" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="p" Content-length: 465 Index: decl.c =================================================================== --- decl.c (revision 220611) +++ decl.c (working copy) @@ -12207,6 +12207,9 @@ lookup_and_check_tag (enum tag_types tag_code, tre && DECL_TEMPLATE_TEMPLATE_PARM_P (decl)))) decl = DECL_TEMPLATE_RESULT (decl); + if (scope == ts_global) + decl = strip_using_decl (decl); + if (decl && TREE_CODE (decl) == TYPE_DECL) { /* Look for invalid nested type: --------------010605000703050501090504--