From 9babc352483293e84371af273b1aa1be037cdf31 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 30 Apr 2015 09:28:48 +0000 Subject: c-typeck.c (set_init_label): Call error_at instead of error and pass LOC to it. * c-typeck.c (set_init_label): Call error_at instead of error and pass LOC to it. * gcc.dg/init-bad-8.c: New test. From-SVN: r222613 --- gcc/c/ChangeLog | 5 +++++ gcc/c/c-typeck.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 6d8dbb1..0ee7f1b 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2015-04-30 Marek Polacek + + * c-typeck.c (set_init_label): Call error_at instead of error and + pass LOC to it. + 2015-04-29 Thomas Schwinge * c-parser.c (c_parser_oacc_enter_exit_data): Use diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index c58e918..466079f 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -7926,7 +7926,7 @@ set_init_label (location_t loc, tree fieldname, field = lookup_field (constructor_type, fieldname); if (field == 0) - error ("unknown field %qE specified in initializer", fieldname); + error_at (loc, "unknown field %qE specified in initializer", fieldname); else do { -- cgit v1.1