gcc/libcpp
David Malcolm c7a980b80b Prevent fix-it hints from affecting more than one line
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
2017-06-20 10:40:38 +00:00
..
include Prevent fix-it hints from affecting more than one line 2017-06-20 10:40:38 +00:00
po Regenerate .pot files. 2017-05-01 23:28:02 +01:00
ChangeLog Prevent fix-it hints from affecting more than one line 2017-06-20 10:40:38 +00:00
ChangeLog.jit
Makefile.in * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL. 2017-02-09 08:55:46 +00:00
aclocal.m4 libcpp: Bump to automake 1.11.6 2015-05-13 11:02:17 +00:00
charset.c Update copyright years. 2017-01-01 13:07:43 +01:00
config.in re PR bootstrap/72823 (r239175 causes build failure) 2016-11-16 21:10:27 +01:00
configure re PR bootstrap/72823 (r239175 causes build failure) 2016-11-16 21:10:27 +01:00
configure.ac re PR bootstrap/72823 (r239175 causes build failure) 2016-11-16 21:10:27 +01:00
directives-only.c Update copyright years. 2017-01-01 13:07:43 +01:00
directives.c Update copyright years. 2017-01-01 13:07:43 +01:00
errors.c Update copyright years. 2017-01-01 13:07:43 +01:00
expr.c Update copyright years. 2017-01-01 13:07:43 +01:00
files.c Update copyright years. 2017-01-01 13:07:43 +01:00
identifiers.c Update copyright years. 2017-01-01 13:07:43 +01:00
init.c * init.c (cpp_init_builtins): Update __cplusplus for C++17. 2017-03-16 17:16:39 -04:00
internal.h Update copyright years. 2017-01-01 13:07:43 +01:00
lex.c libcpp: add callback for comment-handling 2017-06-05 20:53:06 +00:00
line-map.c Prevent fix-it hints from affecting more than one line 2017-06-20 10:40:38 +00:00
location-example.txt Source range tracking in libcpp and C FE, with bit-packing optimization 2015-11-13 16:29:59 +00:00
macro.c Update copyright years. 2017-01-01 13:07:43 +01:00
makeucnid.c Update copyright years. 2017-01-01 13:07:43 +01:00
mkdeps.c Update copyright years. 2017-01-01 13:07:43 +01:00
pch.c Fix numerous typos in comments 2017-04-03 23:30:56 +01:00
symtab.c Update copyright years. 2017-01-01 13:07:43 +01:00
system.h Update copyright years. 2017-01-01 13:07:43 +01:00
traditional.c Update copyright years. 2017-01-01 13:07:43 +01:00
ucnid.h Update copyright years. 2017-01-01 13:07:43 +01:00
ucnid.tab Update copyright years. 2017-01-01 13:07:43 +01:00