public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
@ 2020-06-29 17:50 bergner at linux dot ibm.com
2020-06-29 17:51 ` [Bug build/26183] " bergner at linux dot ibm.com
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: bergner at linux dot ibm.com @ 2020-06-29 17:50 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Bug ID: 26183
Summary: GDB build fails with error: ‘class
std::basic_string_view<char>’ has no member named
‘to_string’
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: bergner at linux dot ibm.com
Target Milestone: ---
Building current gdb trunk source using a gcc trunk build from today, I'm
seeing the following build (powerpc64le-linux) error:
/home/bergner/binutils/binutils-gdb/gdb/ada-lang.c: In constructor
‘ada_lookup_name_info::ada_lookup_name_info(const lookup_name_info&)’:
/home/bergner/binutils/binutils-gdb/gdb/ada-lang.c:13556:50: error: ‘class
std::basic_string_view<char>’ has no member named ‘to_string’
13556 | = user_name.substr (1, user_name.size () - 2).to_string ();
| ^~~~~~~~~
/home/bergner/binutils/binutils-gdb/gdb/ada-lang.c:13559:50: error: ‘class
std::basic_string_view<char>’ has no member named ‘to_string’
13559 | = user_name.substr (1, user_name.size () - 1).to_string ();
| ^~~~~~~~~
/home/bergner/binutils/binutils-gdb/gdb/ada-lang.c:13578:33: error: ‘using
string_view = using string_view = class std::basic_string_view<char>’ {aka
‘class std::basic_string_view<char>’} has no member named ‘to_string’
13578 | m_encoded_name = user_name.to_string ();
| ^~~~~~~~~
/home/bergner/binutils/binutils-gdb/gdb/ada-lang.c:13581:29: error: ‘using
string_view = using string_view = class std::basic_string_view<char>’ {aka
‘class std::basic_string_view<char>’} has no member named ‘to_string’
13581 | m_encoded_name = user_name.to_string ();
| ^~~~~~~~~
make: *** [Makefile:1610: ada-lang.o] Error 1
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
@ 2020-06-29 17:51 ` bergner at linux dot ibm.com
2020-06-29 17:57 ` tuliom at ascii dot art.br
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bergner at linux dot ibm.com @ 2020-06-29 17:51 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Peter Bergner <bergner at linux dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |powerpc64le-linux
Build| |powerpc64le-linux
Host| |powerpc64le-linux
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
2020-06-29 17:51 ` [Bug build/26183] " bergner at linux dot ibm.com
@ 2020-06-29 17:57 ` tuliom at ascii dot art.br
2020-06-29 18:04 ` bergner at linux dot ibm.com
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tuliom at ascii dot art.br @ 2020-06-29 17:57 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tuliom at ascii dot art.br
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
2020-06-29 17:51 ` [Bug build/26183] " bergner at linux dot ibm.com
2020-06-29 17:57 ` tuliom at ascii dot art.br
@ 2020-06-29 18:04 ` bergner at linux dot ibm.com
2020-06-29 18:19 ` tromey at sourceware dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bergner at linux dot ibm.com @ 2020-06-29 18:04 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Peter Bergner <bergner at linux dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #1 from Peter Bergner <bergner at linux dot ibm.com> ---
Adding Tom to CC, since he added the to_string uses to gdb back in April
(commit e0802d59969).
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (2 preceding siblings ...)
2020-06-29 18:04 ` bergner at linux dot ibm.com
@ 2020-06-29 18:19 ` tromey at sourceware dot org
2020-06-29 18:28 ` bergner at linux dot ibm.com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-06-29 18:19 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
The problem was latent before my patch.
I think the issue is that our string_view has to_string,
but C++ officially does not.
https://en.cppreference.com/w/cpp/string/basic_string_view
The gdb one was copied from libstdc++; I don't know if
this represents a local divergence (seems unlikely),
or if upstream / the standard changed.
Probably the solution is to change gdbsupport's string view
to have a "gdb::to_string" free function, then use that
instead. When using the real string view, this can
simply use a string constructor.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (3 preceding siblings ...)
2020-06-29 18:19 ` tromey at sourceware dot org
@ 2020-06-29 18:28 ` bergner at linux dot ibm.com
2020-06-29 18:34 ` tromey at sourceware dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bergner at linux dot ibm.com @ 2020-06-29 18:28 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
--- Comment #3 from Peter Bergner <bergner at linux dot ibm.com> ---
Maybe this libstdc++ change from June 12th?
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cd0b94e650a880b2ab04922e476aa28007277d5c
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (4 preceding siblings ...)
2020-06-29 18:28 ` bergner at linux dot ibm.com
@ 2020-06-29 18:34 ` tromey at sourceware dot org
2020-06-29 18:35 ` tromey at sourceware dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-06-29 18:34 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Sending a patch soon.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (5 preceding siblings ...)
2020-06-29 18:34 ` tromey at sourceware dot org
@ 2020-06-29 18:35 ` tromey at sourceware dot org
2020-06-29 18:36 ` tromey at sourceware dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-06-29 18:35 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Peter Bergner from comment #3)
> Maybe this libstdc++ change from June 12th?
>
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;
> h=cd0b94e650a880b2ab04922e476aa28007277d5c
That one doesn't seem quite like the one, since afaict
it doesn't change basic_string_view.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (6 preceding siblings ...)
2020-06-29 18:35 ` tromey at sourceware dot org
@ 2020-06-29 18:36 ` tromey at sourceware dot org
2020-06-29 18:50 ` simark at simark dot ca
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-06-29 18:36 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at sourceware dot org |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (7 preceding siblings ...)
2020-06-29 18:36 ` tromey at sourceware dot org
@ 2020-06-29 18:50 ` simark at simark dot ca
2020-06-29 19:27 ` tromey at sourceware dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2020-06-29 18:50 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Simon Marchi <simark at simark dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |simark at simark dot ca
--- Comment #6 from Simon Marchi <simark at simark dot ca> ---
Indeed, we copied
./libstdc++-v3/include/experimental/string_view
and not
./libstdc++-v3/include/std/string_view
The use of the experimental one came from this thread:
https://sourceware.org/legacy-ml/gdb-patches/2018-04/msg00097.html
And was implemented in the final version of the patchset:
https://sourceware.org/legacy-ml/gdb-patches/2018-04/msg00111.html
In hindsight, it probably wasn't a good idea. I'll check to see if we can move
to a version based on std/string_view instead.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (8 preceding siblings ...)
2020-06-29 18:50 ` simark at simark dot ca
@ 2020-06-29 19:27 ` tromey at sourceware dot org
2020-06-30 13:55 ` cvs-commit at gcc dot gnu.org
2020-06-30 14:45 ` tromey at sourceware dot org
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-06-29 19:27 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2020-June/169963.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (9 preceding siblings ...)
2020-06-29 19:27 ` tromey at sourceware dot org
@ 2020-06-30 13:55 ` cvs-commit at gcc dot gnu.org
2020-06-30 14:45 ` tromey at sourceware dot org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-30 13:55 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5ac588997c3c2d032d5d5145d9245eb37354c23b
commit 5ac588997c3c2d032d5d5145d9245eb37354c23b
Author: Tom Tromey <tromey@adacore.com>
Date: Tue Jun 30 07:53:03 2020 -0600
Do not define basic_string_view::to_string
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-30 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-30 Tom Tromey <tromey@adacore.com>
PR build/26183:
* gdb_string_view.h (basic_string_view::to_string): Remove.
(gdb::to_string): New function.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug build/26183] GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
` (10 preceding siblings ...)
2020-06-30 13:55 ` cvs-commit at gcc dot gnu.org
@ 2020-06-30 14:45 ` tromey at sourceware dot org
11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2020-06-30 14:45 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26183
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |10.1
--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-06-30 14:45 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 17:50 [Bug build/26183] New: GDB build fails with error: ‘class std::basic_string_view<char>’ has no member named ‘to_string’ bergner at linux dot ibm.com
2020-06-29 17:51 ` [Bug build/26183] " bergner at linux dot ibm.com
2020-06-29 17:57 ` tuliom at ascii dot art.br
2020-06-29 18:04 ` bergner at linux dot ibm.com
2020-06-29 18:19 ` tromey at sourceware dot org
2020-06-29 18:28 ` bergner at linux dot ibm.com
2020-06-29 18:34 ` tromey at sourceware dot org
2020-06-29 18:35 ` tromey at sourceware dot org
2020-06-29 18:36 ` tromey at sourceware dot org
2020-06-29 18:50 ` simark at simark dot ca
2020-06-29 19:27 ` tromey at sourceware dot org
2020-06-30 13:55 ` cvs-commit at gcc dot gnu.org
2020-06-30 14:45 ` tromey at sourceware dot org
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).