* 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
+2015-04-30 Marek Polacek <polacek@redhat.com>
+
+ * c-typeck.c (set_init_label): Call error_at instead of error and
+ pass LOC to it.
+
2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
* c-parser.c (c_parser_oacc_enter_exit_data): Use
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
{
+2015-04-30 Marek Polacek <polacek@redhat.com>
+
+ * gcc.dg/init-bad-8.c: New test.
+
2015-04-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59955
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct S { int i, j, k; };
+
+void
+foo (void)
+{
+ struct S s = { .i = 1, .j = 2, .l = 4}; /* { dg-error "34:unknown field .l. specified in initializer" } */
+}