From patchwork Mon Jun 14 18:12:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 1491812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=QfcbfqeT; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G3fjM3rWXz9sW7 for ; Tue, 15 Jun 2021 04:14:15 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E07D5395541E for ; Mon, 14 Jun 2021 18:14:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E07D5395541E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623694452; bh=e5Eh7b4Sp7QbhLXoU2E4Nwl1P4An1I0Y2OUPB0ShJ5w=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=QfcbfqeTorHckt4+P6a+LjPaqJmx6Ex3zXyACZ4VWCft6WUUCFquwTWtYV/WIZiZ8 L2DWnqKySZ94oqzF8khAzqgvGg4jNJigYhjQW0j6OWdW0aDGtbvnaZG2oAZPixsrtB 1VoG11qWyG9SkC9sIe6O2vlG5V+xqgwJBwqfmd3k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 29CD4395B403; Mon, 14 Jun 2021 18:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29CD4395B403 Received: from pool-96-233-64-159.bstnma.fios.verizon.net ([96.233.64.159]:58486 helo=pdslaptop.home.arpa) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsr4T-0006bD-Sb; Mon, 14 Jun 2021 14:12:25 -0400 Message-ID: <027d6c9f6afd6b64a279cb698454309c1898f6a1.camel@gnu.org> Subject: [PATCH 2/2] libstdc++: Use template form for pretty-printing tuple elements To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Date: Mon, 14 Jun 2021 14:12:25 -0400 Organization: GNU's Not UNIX! User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Smith via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: psmith@gnu.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" std::tuple elements are retrieved via std::get<> (template) not [] (array); have the generated output string match this. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdTuplePrinter): Use <> not []. --- The previous patch seems uncontroversial to me. I don't know about this one: I'm not sure if there's any precedent for this type of output although to me it looks better since tuples cannot be retrieved via array indexing. libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.28.0 diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 14a6d998690..0063a3185a6 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -567,7 +567,7 @@ class StdTuplePrinter: if len (fields) > 0 and fields[0].name == "_M_head_impl": impl = impl['_M_head_impl'] - out = '[%d]' % self.count + out = '<%d>' % self.count self.count = self.count + 1 return (out, impl)