+2017-11-28 David Malcolm <dmalcolm@redhat.com>
+
+ * diagnostic-show-locus.c (layout::print_trailing_fixits): Handle
+ m_x_offset.
+ (layout::move_to_column): Likewise.
+
2017-11-28 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81275
/* Now print the corrections. */
unsigned i;
correction *c;
- int column = 0;
+ int column = m_x_offset;
FOR_EACH_VEC_ELT (corrections.m_corrections, i, c)
{
if (*column > dest_column)
{
print_newline ();
- *column = 0;
+ *column = m_x_offset;
}
while (*column < dest_column)
+2017-11-28 David Malcolm <dmalcolm@redhat.com>
+
+ * gcc.dg/plugin/diagnostic-test-show-locus-bw.c
+ (test_very_wide_line): Update expected output to include a
+ fix-it hint.
+ * gcc.dg/plugin/diagnostic-test-show-locus-color.c
+ (test_very_wide_line): Likewise.
+ * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
+ (test_show_locus): Add a fix-it hint to "test_very_wide_line".
+
2017-11-28 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81275
6789012345678901234567890123456789012345678901234567890123456789012345
float f = foo * bar;
~~~~^~~~~
+ bar * foo
{ dg-end-multiline-output "" } */
#endif
}
6789012345678901234567890123456789012345678901234567890123456789012345
float f = \e[01;35m\e[Kfoo * bar\e[m\e[K;
\e[01;35m\e[K~~~~^~~~~\e[m\e[K
+ \e[32m\e[Kbar * foo\e[m\e[K
{ dg-end-multiline-output "" } */
#endif
}
{
const int line = fnstart_line + 2;
global_dc->show_ruler_p = true;
- warning_at (make_location (get_loc (line, 94), get_loc (line, 90),
- get_loc (line, 98)),
- 0, "test");
+ rich_location richloc (line_table,
+ make_location (get_loc (line, 94),
+ get_loc (line, 90),
+ get_loc (line, 98)));
+ richloc.add_fixit_replace ("bar * foo");
+ warning_at (&richloc, 0, "test");
global_dc->show_ruler_p = false;
}