The previous patch uncovered a bug in how c_parser_expr_list builds the vec<location_t>: it was only using the location of the first token within each assignment-expression in the expr-list. This shows up in e.g. this -Wformat warning, where only part of the 2nd param is underlined: printf("hello %i", (long)0); ~^ ~ %li This patch fixes c_parser_expr_list to use the full range of each assignment-expression in the list for the vec<location_t>, so that for the above we print: printf("hello %i", (long)0); ~^ ~~~~~~~ %li gcc/c/ChangeLog: * c-parser.c (c_parser_expr_list): Use c_expr::get_location () rather than peeking the location of the first token. * c-tree.h (c_expr::get_location): New method. gcc/testsuite/ChangeLog: * gcc.dg/format/diagnostic-ranges.c (test_mismatching_types): Update expected result to show all of "(long)0" being underlined. * gcc.dg/plugin/diagnostic-test-string-literals-1.c (test_multitoken_macro): Update expected underlining. From-SVN: r251239
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ChangeLog | Loading commit data... | |
Make-lang.in | Loading commit data... | |
c-array-notation.c | Loading commit data... | |
c-aux-info.c | Loading commit data... | |
c-convert.c | Loading commit data... | |
c-decl.c | Loading commit data... | |
c-errors.c | Loading commit data... | |
c-fold.c | Loading commit data... | |
c-lang.c | Loading commit data... | |
c-lang.h | Loading commit data... | |
c-objc-common.c | Loading commit data... | |
c-objc-common.h | Loading commit data... | |
c-parser.c | Loading commit data... | |
c-parser.h | Loading commit data... | |
c-tree.h | Loading commit data... | |
c-typeck.c | Loading commit data... | |
config-lang.in | Loading commit data... | |
gccspec.c | Loading commit data... | |
gimple-parser.c | Loading commit data... | |
gimple-parser.h | Loading commit data... |