From 2b9ed6db3fb08feab70857dc7eb94fbe6a45e069 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 17 Aug 2023 10:41:34 +0200 Subject: [PATCH] [gdb/build, c++20] Fix invalid conversion in test_symbols MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When building gdb with -std=c++20, I run into: ... gdb/dwarf2/read.c:2709:3: error: invalid conversion from ‘const char8_t*’ to \ ‘const char*’ [-fpermissive] 2709 | u8"u8função", | ^~~~~~~~~~~~ | | | const char8_t* ... Fix this by making the conversion explicit. Tested on x86_64-linux. --- gdb/dwarf2/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 245117cc1c7..f1d7bfdfdec 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2706,7 +2706,7 @@ static const char *test_symbols[] = { /* A UTF-8 name with multi-byte sequences to make sure that cp-name-parser understands this as a single identifier ("função" is "function" in PT). */ - u8"u8função", + (const char *)u8"u8função", /* Test a symbol name that ends with a 0xff character, which is a valid character in non-UTF-8 source character sets (e.g. Latin1 -- 2.30.2