Attempts to apply a removal or replacement fix-it hint to a source range that covers multiple lines currently lead to nonsensical results from the printing code in diagnostic-show-locus.c. We were already filtering them out in edit-context.c (leading to -fdiagnostics-generate-patch not generating any output for the whole TU). Reject attempts to add such fix-it hints within rich_location, fixing the diagnostic-show-locus.c issue. gcc/ChangeLog: * diagnostic-show-locus.c (selftest::test_fixit_deletion_affecting_newline): New function. (selftest::diagnostic_show_locus_c_tests): Call it. libcpp/ChangeLog: * include/line-map.h (class rich_location): Document that attempts to delete or replace a range *affecting* multiple lines will fail. * line-map.c (rich_location::maybe_add_fixit): Implement this restriction. From-SVN: r249403
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| include | Loading commit data... | |
| po | Loading commit data... | |
| ChangeLog | Loading commit data... | |
| ChangeLog.jit | Loading commit data... | |
| Makefile.in | Loading commit data... | |
| aclocal.m4 | Loading commit data... | |
| charset.c | Loading commit data... | |
| config.in | Loading commit data... | |
| configure | Loading commit data... | |
| configure.ac | Loading commit data... | |
| directives-only.c | Loading commit data... | |
| directives.c | Loading commit data... | |
| errors.c | Loading commit data... | |
| expr.c | Loading commit data... | |
| files.c | Loading commit data... | |
| identifiers.c | Loading commit data... | |
| init.c | Loading commit data... | |
| internal.h | Loading commit data... | |
| lex.c | Loading commit data... | |
| line-map.c | Loading commit data... | |
| location-example.txt | Loading commit data... | |
| macro.c | Loading commit data... | |
| makeucnid.c | Loading commit data... | |
| mkdeps.c | Loading commit data... | |
| pch.c | Loading commit data... | |
| symtab.c | Loading commit data... | |
| system.h | Loading commit data... | |
| traditional.c | Loading commit data... | |
| ucnid.h | Loading commit data... | |
| ucnid.tab | Loading commit data... |