From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23637 invoked by alias); 9 Nov 2013 13:23:07 -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 23628 invoked by uid 89); 9 Nov 2013 13:23:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_50,RDNS_NONE autolearn=no version=3.3.2 X-HELO: avasout07.plus.net Received: from Unknown (HELO avasout07.plus.net) (84.93.230.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Nov 2013 13:21:43 +0000 Received: from webmail.plus.net ([84.93.228.66]) by avasout07 with smtp id nRMa1m0051SbfYc01RMa7s; Sat, 09 Nov 2013 13:21:34 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=O/UA4nNW c=1 sm=1 tr=0 a=C5+YawzV8SR07mwocaP9vA==:117 a=rJgRRbfb+UpHm5KwX9t5uQ==:17 a=0Bzu9jTXAAAA:8 a=EDeDkkTReK4A:10 a=dYCPD3cKDi0A:10 a=I106C3lr20QA:10 a=5LfTt-Tm1vgA:10 a=IkcTkHD0fZMA:10 a=ZBkl__CYAAAA:8 a=mrHjP8x4AAAA:8 a=7vtFykjVAAAA:8 a=UcJh_ttk9pMA:10 a=Nv90wq7HCMFwsr7gHRAA:9 a=QEXdDO2ut3YA:10 X-AUTH: jessaminenet+adam:2501 Received: from munkyhouse.force9.co.uk ([84.92.244.81]) by webmail.plus.net with HTTP (HTTP/1.1 POST); Sat, 09 Nov 2013 13:21:34 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 09 Nov 2013 13:56:00 -0000 From: Adam Butcher To: Jason Merrill Cc: , Volker Reichelt Subject: Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637. In-Reply-To: <527D328D.9010800@redhat.com> References: <1383212824-5493-1-git-send-email-adam@jessamine.co.uk> <1383212824-5493-2-git-send-email-adam@jessamine.co.uk> <527D328D.9010800@redhat.com> Message-ID: <48a0350ad377d7ec6de413e61724fe4e@imap.force9.net> X-Sender: adam@jessamine.co.uk User-Agent: Roundcube Webmail/0.7.4 X-SW-Source: 2013-11/txt/msg00999.txt.bz2 On 2013-11-08 18:50, Jason Merrill wrote: > On 10/31/2013 05:47 AM, Adam Butcher wrote: >> + become_template = true; >> >> + push_deferring_access_checks (dk_deferred); > > Why is this call here? I don't see anything in the rest of the > function that would trigger an access check, or a matching pop. > This is only in the 'fully implicit function template' case; and the matching pop is in finish_fully_implicit_template. It was in the original impl which was trying to do all the things that beginning and ending an explicit template parameter list did. Maybe this is unnecessary. I'll see if anything breaks if I remove it. >> + /* Create a distinct parameter pack type from the current >> parm and add it >> + to the replacement args to tsubst below into the generic >> function >> + parameter. */ >> + >> + tree t = copy_type (TREE_TYPE (TREE_VALUE (TREE_VEC_ELT >> (current, i)))); >> + TYPE_STUB_DECL (t) = TYPE_NAME (t) = TEMPLATE_TYPE_DECL (t); > > Is this changing anything? I'm not sure if we need to copy the decl > or if we can just reuse it, but either way we need to set the type of > TEMPLATE_TYPE_DECL (t) to t. > I think it (or at least one of the assignments) is necessary. It is derived from some similar code in tsubst. I'll have another look into it and add TREE_TYPE (TEMPLATE_TYPE_DECL (t)) = t also. What problem will be caused by not setting the latter; is it a consistency issue? I have not seen any probs in testing so far. >> + SET_TYPE_STRUCTURAL_EQUALITY (t); > > Why not > > TYPE_CANONICAL (t) = canonical_type_parameter (t); > > ? > Only for the sake of not exposing this (currently static) function from pt.c (or moving the pack convert function into pt.c). My original impl did extern canonical_type_parameter and use that and I think it worked as expected. Would that be preferred? Cheers, Adam