* c-common.c (braced_list_to_string): Remove eval parameter.
commitd839099fb30a8ab216a7c6be7cf1788dee336815
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Sep 2018 15:18:30 +0000 (2 15:18 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Sep 2018 15:18:30 +0000 (2 15:18 +0000)
treec7acad98ebfa1677eaab8a2c4024707a021dc363
parent9fe2a0427fb2722b5974176ee42ca6a5a3d3f707
* c-common.c (braced_list_to_string): Remove eval parameter.
Add some more checks.  Always create zero-terminated STRING_CST.
* c-common.h (braced_list_to_string): Adjust prototype.

* c-decl.c (finish_decl): Call braced_list_to_string here ...
* c-parser.c (c_parser_declaration_or_fndef): ... instead of here.

* decl.c (eval_check_narrowing): Remove.
(check_initializer): Move call to braced_list_to_string from here ...
* typeck2.c (store_init_value): ... to here.
(digest_init_r): Remove handing of signed/unsigned char strings.

* c-c++-common/array-init.c: New test.
* g++.dg/init/string2.C: Remove xfail.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264042 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/array-init.c [new file with mode: 0644]
gcc/testsuite/g++.dg/init/string2.C