public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-1956] Adjust index number of tuple pretty printer Date: Thu, 4 Aug 2022 11:21:03 +0000 (GMT) [thread overview] Message-ID: <20220804112103.AE99B3858407@sourceware.org> (raw) https://gcc.gnu.org/g:075683767abe15b936ad41792da6ee71e9eda449 commit r13-1956-g075683767abe15b936ad41792da6ee71e9eda449 Author: Ulrich Drepper <drepper@gmail.com> Date: Thu Aug 4 13:18:05 2022 +0200 Adjust index number of tuple pretty printer The tuple pretty printer uses 1-based indeces which is quite confusing considering the access to the same values with the std::get functions uses 0-based indeces. This patch changes the pretty printer since this is not a guaranteed API. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (class StdTuplePrinter): Use zero-based indeces just like std:get takes. Diff: --- libstdc++-v3/python/libstdcxx/v6/printers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 17c33c1e54f..d70c8d5d616 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -611,9 +611,9 @@ class StdTuplePrinter: # the value "as is". fields = impl.type.fields () if len (fields) < 1 or fields[0].name != "_M_head_impl": - return ('[%d]' % self.count, impl) + return ('[%d]' % (self.count - 1), impl) else: - return ('[%d]' % self.count, impl['_M_head_impl']) + return ('[%d]' % (self.count - 1), impl['_M_head_impl']) def __init__ (self, typename, val): self.typename = strip_versioned_namespace(typename)
reply other threads:[~2022-08-04 11:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220804112103.AE99B3858407@sourceware.org \ --to=drepper@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).