re PR c/61096 (error_init lacks a location)
authorMarek Polacek <polacek@redhat.com>
Fri, 9 May 2014 17:50:25 +0000 (17:50 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 9 May 2014 17:50:25 +0000 (17:50 +0000)
commitea58ef42e54fde03cc8e57cfb59c4c5d7ec1806a
treecd6331ec639c692e7b4cbb94402526fdfa70a6b8
parent4f61140c2a7c3ade3c0ccd0514c3136efc2c0b18
re PR c/61096 (error_init lacks a location)

PR c/61096
* c-parser.c (c_parser_braced_init): Pass brace_loc to push_init_level.
(c_parser_initelt): Pass location to set_init_label.  Pass array index
location to set_init_index.
* c-tree.h (push_init_level): Update declaration.
(pop_init_level): Likewise.
(set_init_index): Likewise.
(set_init_label): Likewise.
* c-typeck.c (error_init): Add location parameter.  Call error_at
instead of error.
(digest_init): Pass init_loc to error_init.
(really_start_incremental_init):
(push_init_level): Add location parameter.  Pass loc to pop_init_level
and error_init.
(pop_init_level): Likewise.
(set_designator): Add location parameter.  Pass loc to pop_init_level,
push_init_level, and error_init.
(set_init_index): Add location parameter.  Pass loc to error_init and
set_designator.
(set_init_label): Likewise.
(output_init_element): Pass loc to error_init.
(process_init_element): Pass loc to error_init, pop_init_level,
pedwarn_init, and push_init_level.

* gcc.dg/pr61096-1.c: New test.
* gcc.dg/pr61096-2.c: New test.

From-SVN: r210280
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr61096-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr61096-2.c [new file with mode: 0644]