C: fixits for named initializers
commit527790c1e82b211e61b4aa11538008836abfc812
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jun 2016 17:14:42 +0000 (13 17:14 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jun 2016 17:14:42 +0000 (13 17:14 +0000)
tree2eb2383fe9349016fa39c6cb44fb770d7da1cc4b
parentbe2a5a8e8ffd13c099d372c4fcc363d5cd3c83c2
C: fixits for named initializers

gcc/c/ChangeLog:
* c-parser.c (c_parser_initelt): Provide location of name for new
location_t param of set_init_label.
* c-tree.h (set_init_label): Add location_t param.
* c-typeck.c (set_init_index): Add "fieldname_loc" location_t
param and use it when issuing error messages about unrecognized
field names.  Attempt to provide a fixit hint if appropriate,
otherwise update the error message to provide the type name.

gcc/testsuite/ChangeLog:
* gcc.dg/c99-init-2.c (c): Update expected error message.
* gcc.dg/init-bad-8.c (foo): Likewise.
* gcc.dg/spellcheck-fields-3.c: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237387 138bc75d-0d04-0410-961f-82ee72b054a4
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/c99-init-2.c
gcc/testsuite/gcc.dg/init-bad-8.c
gcc/testsuite/gcc.dg/spellcheck-fields-3.c [new file with mode: 0644]