From ea58ef42e54fde03cc8e57cfb59c4c5d7ec1806a Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 9 May 2014 17:50:25 +0000 Subject: 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/c-tree.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/c/c-tree.h') diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index a6e7327..ae932fa 100644 --- a/gcc/c/c-tree.h +++ b/gcc/c/c-tree.h @@ -606,10 +606,10 @@ extern void maybe_warn_string_init (tree, struct c_expr); extern void start_init (tree, tree, int); extern void finish_init (void); extern void really_start_incremental_init (tree); -extern void push_init_level (int, struct obstack *); -extern struct c_expr pop_init_level (int, struct obstack *); -extern void set_init_index (tree, tree, struct obstack *); -extern void set_init_label (tree, struct obstack *); +extern void push_init_level (location_t, int, struct obstack *); +extern struct c_expr pop_init_level (location_t, int, struct obstack *); +extern void set_init_index (location_t, tree, tree, struct obstack *); +extern void set_init_label (location_t, tree, struct obstack *); extern void process_init_element (location_t, struct c_expr, bool, struct obstack *); extern tree build_compound_literal (location_t, tree, tree, bool); -- cgit v1.1