From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Do not define basic_string_view::to_string
Date: Mon, 29 Jun 2020 16:44:04 -0400 [thread overview]
Message-ID: <57f5e2b0-e1fb-dc9e-0933-40d3cc13d8ed@simark.ca> (raw)
In-Reply-To: <20200629190810.4758-1-tromey@adacore.com>
On 2020-06-29 3:08 p.m., Tom Tromey wrote:
> gdb's copy of basic_string_view includes a to_string method. However,
> according to cppreference, this is not a method on the real
> std::basic_string_view:
>
> https://en.cppreference.com/w/cpp/string/basic_string_view
>
> This difference matters because gdb_string_view.h will use the
> standard implementation when built with a C++17 or later. This caused
> PR build/26183.
>
> This patch fixes the problem by changing the method to be a standalone
> helper function, and then rewriting the uses. Tested by rebuilding
> with a version of GCC that defaults to C++17.
>
> (Note that the build still is not clean; and also I noticed that the
> libstdc++ string_view forbids the use of nullptr ... I wonder if gdb
> violates that.)
>
> gdb/ChangeLog
> 2020-06-29 Tom Tromey <tromey@adacore.com>
>
> PR build/26183:
> * ada-lang.c (ada_lookup_name_info::ada_lookup_name_info): Use
> gdb::to_string.
>
> gdbsupport/ChangeLog
> 2020-06-29 Tom Tromey <tromey@adacore.com>
>
> PR build/26183:
> * gdb_string_view.h (basic_string_view::to_string): Remove.
> (gdb::to_string): New function.
Thanks, this LGTM.
Simon
next prev parent reply other threads:[~2020-06-29 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 19:08 Tom Tromey
2020-06-29 20:44 ` Simon Marchi [this message]
2020-06-30 2:22 ` Peter Bergner
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=57f5e2b0-e1fb-dc9e-0933-40d3cc13d8ed@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/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: link
Be 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