aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-01-27 16:38:32 +0100
committerTom de Vries <tdevries@suse.de>2025-01-27 16:38:32 +0100
commit163d99117597022dbcb70f5da6a03646876c2f5f (patch)
tree1999c5364df70651b63d30883308abeabcc00adb /gdb
parent665888ea416e3b9b764ba2290af7dc69dbd6f25c (diff)
downloadgdb-163d99117597022dbcb70f5da6a03646876c2f5f.zip
gdb-163d99117597022dbcb70f5da6a03646876c2f5f.tar.gz
gdb-163d99117597022dbcb70f5da6a03646876c2f5f.tar.bz2
[gdb/build] Fix build with gcc 7.5.0
When building gdb with gcc 7.5.0, I run into: ... gdb/dwarf2/cooked-index.c: In lambda function: gdb/dwarf2/cooked-index.c:104:5: error: \ the value of ‘_sch_tolower’ is not usable in a constant expression }; ^ In file included from gdbsupport/gdb-safe-ctype.h:47:0, from gdb/dwarf2/cooked-index.c:34: include/safe-ctype.h:111:29: note: ‘_sch_tolower’ was not declared ‘constexpr’ extern const unsigned char _sch_tolower[256]; ^~~~~~~~~~~~ ... This does not happen with gcc 8.2.1. Fix this by dropping the constexpr on lambda function munge in cooked_index_entry::compare for gcc 7. Tested by completing the build on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/cooked-index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index e024c78..1b08ba4 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -93,7 +93,12 @@ int
cooked_index_entry::compare (const char *stra, const char *strb,
comparison_mode mode)
{
+#if defined (__GNUC__) && !defined (__clang__) && __GNUC__ <= 7
+ /* Work around error with gcc 7.5.0. */
+ auto munge = [] (char c) -> unsigned char
+#else
auto munge = [] (char c) constexpr -> unsigned char
+#endif
{
/* Treat '<' as if it ended the string. This lets something
like "func<t>" match "func<t<int>>". See the "Breakpoints in