diff options
Diffstat (limited to 'gcc/c-family/c-format.cc')
-rw-r--r-- | gcc/c-family/c-format.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/c-family/c-format.cc b/gcc/c-family/c-format.cc index 80430e9..bf144d0 100644 --- a/gcc/c-family/c-format.cc +++ b/gcc/c-family/c-format.cc @@ -32,7 +32,8 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic.h" #include "substring-locations.h" #include "selftest.h" -#include "selftest-diagnostic.h" +#include "diagnostics/selftest-context.h" +#include "diagnostics/file-cache.h" #include "builtins.h" #include "attribs.h" #include "c-family/c-type-mismatch.h" @@ -4634,7 +4635,7 @@ get_corrected_substring (const substring_loc &fmt_loc, if (caret.column > finish.column) return NULL; - char_span line + diagnostics::char_span line = global_dc->get_file_cache ().get_source_line (start.file, start.line); if (!line) return NULL; @@ -4646,7 +4647,8 @@ get_corrected_substring (const substring_loc &fmt_loc, specification, up to the (but not including) the length modifier. In the above example, this would be "%-+*.*". */ int length_up_to_type = caret.column - start.column; - char_span prefix_span = line.subspan (start.column - 1, length_up_to_type); + diagnostics::char_span prefix_span + = line.subspan (start.column - 1, length_up_to_type); char *prefix = prefix_span.xstrdup (); /* Now attempt to generate a suggestion for the rest of the specification @@ -5584,10 +5586,12 @@ test_type_mismatch_range_labels () gcc_rich_location richloc (fmt, &fmt_label, nullptr); richloc.add_range (param, SHOW_RANGE_WITHOUT_CARET, ¶m_label); - test_diagnostic_context dc; + diagnostics::selftest::test_context dc; diagnostic_show_locus (&dc, - dc.m_source_printing, - &richloc, DK_ERROR, dc.get_reference_printer ()); + dc.get_source_printing_options (), + &richloc, + diagnostics::kind::error, + dc.get_reference_printer ()); if (c_dialect_cxx ()) /* "char*", without a space. */ ASSERT_STREQ (" printf (\"msg: %i\\n\", msg);\n" |