aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-06-30 07:53:03 -0600
committerTom Tromey <tromey@adacore.com>2020-06-30 07:53:03 -0600
commit5ac588997c3c2d032d5d5145d9245eb37354c23b (patch)
tree984da0cf53258094e83d06c9bac4b85ef6d798dc /gdb
parent5568cc9ee83148042b853131a33007a9f36ab1eb (diff)
downloadgdb-5ac588997c3c2d032d5d5145d9245eb37354c23b.zip
gdb-5ac588997c3c2d032d5d5145d9245eb37354c23b.tar.gz
gdb-5ac588997c3c2d032d5d5145d9245eb37354c23b.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fb1912c..ddd831e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2020-06-29 Simon Marchi <simon.marchi@efficios.com>
* gdbarch.sh (displaced_step_copy_insn): Update doc.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 9b0c2ef..98508c1 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -13553,10 +13553,10 @@ ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name)
{
if (user_name.back () == '>')
m_encoded_name
- = user_name.substr (1, user_name.size () - 2).to_string ();
+ = gdb::to_string (user_name.substr (1, user_name.size () - 2));
else
m_encoded_name
- = user_name.substr (1, user_name.size () - 1).to_string ();
+ = gdb::to_string (user_name.substr (1, user_name.size () - 1));
m_encoded_p = true;
m_verbatim_p = true;
m_wild_match_p = false;
@@ -13575,10 +13575,10 @@ ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name)
if (encoded != NULL)
m_encoded_name = encoded;
else
- m_encoded_name = user_name.to_string ();
+ m_encoded_name = gdb::to_string (user_name);
}
else
- m_encoded_name = user_name.to_string ();
+ m_encoded_name = gdb::to_string (user_name);
/* Handle the 'package Standard' special case. See description
of m_standard_p. */