From patchwork Sun Sep 22 12:41:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Butcher X-Patchwork-Id: 276973 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B30CB2C00B3 for ; Sun, 22 Sep 2013 22:41:59 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:content-transfer-encoding:date:from :to:cc:subject:in-reply-to:references:message-id; q=dns; s= default; b=ScIJ8hBsAGEutgWl/e7I+1bayndXLVLXOX7HdHibaQyp3v+oEYSl0 +7HzRVPjvMjNryeozyWlS1aVFuDc6pBu7jg8q583nlr82ZRwqTwwTrCWJGDug/6d dqR5SDhegU96PS0odiF7j0Ahk1JylKoyt6ru6xMWa3DHr5VGCYn50U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:content-transfer-encoding:date:from :to:cc:subject:in-reply-to:references:message-id; s=default; bh= 0c6916PpzTqDdLwkkkBs+ganqR0=; b=sZwIFPN/eszzQK7/D12bg25EQmG+ovdd BL+7yUsJ1EEbh+/Emo77Y4ZgnudDZkTe8w52N/emttCMPBsgbU/kO8fLXchqDsHL zck+MKM5OZYNJVl+CW6xCJsj/FHwM+tzZzRKjS05wTPCoAdSyIcLwBc7uwPYhNMz q1vrYRQ8+90= Received: (qmail 17519 invoked by alias); 22 Sep 2013 12:41:53 -0000 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 Received: (qmail 17509 invoked by uid 89); 22 Sep 2013 12:41:53 -0000 Received: from avasout04.plus.net (HELO avasout04.plus.net) (212.159.14.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Sep 2013 12:41:53 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_20, RCVD_IN_SEMBLACK, RCVD_IN_SORBS_DUL, RDNS_NONE autolearn=no version=3.3.2 X-HELO: avasout04.plus.net Received: from webmail.plus.net ([84.93.237.98]) by avasout04 with smtp id UCho1m004283uBY01Chp54; Sun, 22 Sep 2013 13:41:49 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=MqNrtQqe c=1 sm=1 tr=0 a=BJaFPv9AyABFDM2hXLRoEA==:117 a=rJgRRbfb+UpHm5KwX9t5uQ==:17 a=0Bzu9jTXAAAA:8 a=EDeDkkTReK4A:10 a=dYCPD3cKDi0A:10 a=2ojhLDkw2U4A:10 a=5LfTt-Tm1vgA:10 a=IkcTkHD0fZMA:10 a=ZBkl__CYAAAA:8 a=mrHjP8x4AAAA:8 a=7vtFykjVAAAA:8 a=m-IQIRYerBoA:10 a=xSW7RMM7Nax9dFToDSIA: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); Sun, 22 Sep 2013 13:41:48 +0100 MIME-Version: 1.0 Date: Sun, 22 Sep 2013 13:41:48 +0100 From: Adam Butcher To: Jason Merrill Cc: Subject: Re: [C++1y] [PATCH 1/4] Use translation-unit-global rather than parameter-list-local counter for generic type names to facilitate nested implicit function templates. In-Reply-To: <523C89DF.2080706@redhat.com> References: <1379615867-21555-1-git-send-email-adam@jessamine.co.uk> <1379615867-21555-2-git-send-email-adam@jessamine.co.uk> <523C89DF.2080706@redhat.com> Message-ID: <8cc60b80eb233f0314e889da4d1861ac@imap.force9.net> X-Sender: adam@jessamine.co.uk User-Agent: Roundcube Webmail/0.7.4 On 20.09.2013 18:46, Jason Merrill wrote: > On 09/19/2013 02:37 PM, Adam Butcher wrote: >> + static int i = 0; > > I think this needs to be global and GTY so that it works properly > with PCH. > Didn't consider PCH. This delta OK? --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -28897,12 +28897,12 @@ c_parse_file (void) /* Create an identifier for a generic parameter type (a synthesized template parameter implied by `auto' or a concept identifier). */ +static GTY(()) int generic_parm_count; static tree make_generic_type_name () { char buf[32]; - static int i = 0; - sprintf (buf, "", ++i); + sprintf (buf, "", ++generic_parm_count); return get_identifier (buf); }