[Bug cli/34514] New: cli-style.c build failure (error: conversion from ‘const char 8_t [8]’ to non-scalar type ‘std::string ’ {aka ‘std::__cxx11::basic_string<char> ’} requested)

sam at gentoo dot org via Gdb-prs <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34514

            Bug ID: 34514
           Summary: cli-style.c build failure (error: conversion from
                    ‘const char8_t [8]’ to non-scalar type ‘std::string’
                    {aka ‘std::__cxx11::basic_string<char>’} requested)
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: sam at gentoo dot org
                CC: vries at gcc dot gnu.org
  Target Milestone: ---

This is from GCC trunk, but it happens with 16 too, as it defaults to
-std=gnu++20:
```
$ x86_64-pc-linux-gnu-g++ -x c++    -I. -I. -I./config -include ./defs.h
-DLOCALEDIR="\"/usr/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode
-I../bfd -I./../bfd -I./../include    -I../libdecnumber -I./../libdecnumber 
-I./../gnulib/import -I../gnulib/import -I./.. -I.. -I./../libbacktrace/
-I../libbacktrace/ -DTUI=1    -I/usr/include/python3.14
-I/usr/include/python3.14   -I./.. -pthread    -Wall -Wdangling-reference
-Wdeprecated-copy -Wdeprecated-copy-dtor -Wduplicated-cond -Wempty-body
-Wimplicit-fallthrough=5 -Wmissing-declarations -Wno-char-subscripts
-Wno-mismatched-tags -Wno-sign-compare -Wno-error=maybe-uninitialized
-Wno-switch -Wno-unused -Wpointer-arith -Wredundant-move -Wshadow=local
-Wstrict-null-sentinel -Wsuggest-override -Wunused-but-set-parameter
-Wunused-but-set-variable -Wunused-const-variable=1 -Wunused-function
-Wunused-label -Wunused-local-typedefs -Wunused-value -Wunused-variable -Wvla
-Wformat -Wformat-nonliteral  -O3 -march=native -flto=jobserver
-fno-semantic-interposition -ggdb3 -pipe -fcf-protection=none
-fdiagnostics-color=always -fdiagnostics-urls=never -frecord-gcc-switches
-fdiagnostics-show-context=3 --param=ggc-min-expand=120 -Wstrict-aliasing
-Wfree-nonheap-object -Wuninitialized -Wmaybe-uninitialized -Wreturn-type
-Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr -Warray-bounds
-Wstringop-overread -Wstringop-overflow -Wstringop-truncation -Wformat-overflow
-Wformat-truncation -Wrestrict -ggdb3  -c -o cli/cli-style.o -MT
cli/cli-style.o -MMD -MP -MF cli/.deps/cli-style.Tpo cli/cli-style.c
cli/cli-style.c:457:37: error: conversion from ‘const char8_t [8]’ to
non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
requested
  457 | static std::string warning_prefix = u8"\u26A0\uFE0F ";
      |                                     ^~~~~~~~~~~~~~~~~
cli/cli-style.c:482:35: error: conversion from ‘const char8_t [5]’ to
non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
requested
  482 | static std::string error_prefix = u8"\u274C ";
```

-std=gnu++17 works fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.