aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-09-02 15:18:30 +0000
committerJeff Law <law@gcc.gnu.org>2018-09-02 09:18:30 -0600
commitb5764229c1ea7ef49d480eca3c13ee460da45a56 (patch)
treec7acad98ebfa1677eaab8a2c4024707a021dc363 /gcc/c/c-parser.c
parentb101633fa6b8d7f47943857587c6f83c277482f7 (diff)
downloadgcc-b5764229c1ea7ef49d480eca3c13ee460da45a56.zip
gcc-b5764229c1ea7ef49d480eca3c13ee460da45a56.tar.gz
gcc-b5764229c1ea7ef49d480eca3c13ee460da45a56.tar.bz2
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
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 28384df..69ed5ae 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -2127,15 +2127,6 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
if (d != error_mark_node)
{
maybe_warn_string_init (init_loc, TREE_TYPE (d), init);
-
- /* Try to convert a string CONSTRUCTOR into a STRING_CST. */
- tree valtype = TREE_TYPE (init.value);
- if (TREE_CODE (init.value) == CONSTRUCTOR
- && TREE_CODE (valtype) == ARRAY_TYPE
- && TYPE_STRING_FLAG (TREE_TYPE (valtype)))
- if (tree str = braced_list_to_string (valtype, init.value))
- init.value = str;
-
finish_decl (d, init_loc, init.value,
init.original_type, asm_name);
}