From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115039 invoked by alias); 26 Oct 2017 20:37:51 -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 115017 invoked by uid 89); 26 Oct 2017 20:37:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1122, HContent-Transfer-Encoding:8bit X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Oct 2017 20:37:49 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D5A15AFC7; Thu, 26 Oct 2017 20:37:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9D5A15AFC7 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jwakely@redhat.com Received: from localhost (unknown [10.33.36.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id 514665EE02; Thu, 26 Oct 2017 20:37:48 +0000 (UTC) Date: Thu, 26 Oct 2017 20:41:00 -0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: Fix pretty printers for versioned namespace Message-ID: <20171026203747.GM9153@redhat.com> References: <29900c34-03ae-453d-3e96-401620b4f5c8@gmail.com> <20171026203008.GL9153@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171026203008.GL9153@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2017-10/txt/msg02005.txt.bz2 On 26/10/17 21:30 +0100, Jonathan Wakely wrote: >On 26/10/17 22:19 +0200, François Dumont wrote: >>@@ -1232,7 +1232,7 @@ class Printer(object): >> # Add a name using _GLIBCXX_BEGIN_NAMESPACE_CONTAINER. >> def add_container(self, base, name, function): >> self.add_version(base, name, function) >>- self.add_version(base + '__cxx1998::', name, function) >>+ self.add_version(base, '__cxx1998::' + name, function) > >I don't like this change. > >Previously the arguments were the namespace(s) and the type. That's >nice and simple. > >Now it's the first namespace, and then all the other namespaces and >the type. That's not very clean. > >There must be a way to keep the add_version and add_container calls >the same, and have it transparently handle the case where the >namespace is 'std::__8::foo' not 'std::foo'. e.g. in add_version instead of: if _versioned_namespace: self.add(base + _versioned_namespace + name, function) We should replace "std::" in base with "std::" + _versioned_namespace That means we only have to change that function, not every call to it.