c-common.c (braced_list_to_string): Remove eval parameter.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 2 Sep 2018 15:18:30 +0000 (15:18 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 2 Sep 2018 15:18:30 +0000 (09:18 -0600)
commitb5764229c1ea7ef49d480eca3c13ee460da45a56
treec7acad98ebfa1677eaab8a2c4024707a021dc363
parentb101633fa6b8d7f47943857587c6f83c277482f7
c-common.c (braced_list_to_string): Remove eval parameter.

* 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.

From-SVN: r264042
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