[Bug c++/87476] New: [9 Regression] char-array initialized from wide-string

larsbj at gullik dot net gcc-bugzilla@gcc.gnu.org
Mon Oct 1 10:23:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87476

            Bug ID: 87476
           Summary: [9 Regression] char-array initialized from wide-string
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: larsbj at gullik dot net
  Target Milestone: ---

Created attachment 44771
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44771&action=edit
Source showing error

Using g++ -v
Using built-in specs.
COLLECT_GCC=/opt/gcc/gcc-9/bin/g++
COLLECT_LTO_WRAPPER=/opt/gcc/gcc-9/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/opt/gcc/gcc-9
--enable-checking=release --enable-languages=c,c++
Thread model: posix
gcc version 9.0.0 20180925 (experimental) (GCC)

When compiling the attached source snippet I get:

g++ -c foo.cpp
foo.cpp: In instantiation of ‘void f< <template-parameter-1-1> >::operator()()
[with <template-parameter-1-1> = int]’:
foo.cpp:9:14:   required from here
foo.cpp:4:33: error: char-array initialized from wide string
4 |         constexpr unsigned char p[1]{};
  |

With g++ --version
g++ (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
this compiles without any errors.


More information about the Gcc-bugs mailing list