gcc/libcpp
David Malcolm b09649fdc6 Add support for mutually-incompatible fix-it hints
This patch adds a method:
  rich_location::fixits_cannot_be_auto_applied
for ensuring that mutually-incompatible fix-its hints don't
lead to insane output from -fdiagnostics-generate-patch.

Fix-it hints within such rich_location instances are printed
as normal by diagnostic_show_locus, but don't affect the output
of -fdiagnostics-generate-patch.

gcc/ChangeLog:
	* diagnostic.c (diagnostic_report_diagnostic): Only add fixits
	to the edit_context if they can be auto-applied.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic-test-show-locus-bw.c
	(test_mutually_exclusive_suggestions): New test function.
	* gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c
	(test_mutually_exclusive_suggestions): New test function.
	* gcc.dg/plugin/diagnostic-test-show-locus-parseable-fixits.c
	(test_mutually_exclusive_suggestions): New test function.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
	(test_show_locus): Add special-case for
	"test_mutually_exclusive_suggestions".

libcpp/ChangeLog:
	* include/line-map.h
	(rich_location::fixits_cannot_be_auto_applied): New method.
	(rich_location::fixits_can_be_auto_applied_p): New accessor.
	(rich_location::m_fixits_cannot_be_auto_applied): New field.
	* line-map.c (rich_location::rich_location): Initialize new field.

From-SVN: r249081
2017-06-09 20:57:38 +00:00
..
include Add support for mutually-incompatible fix-it hints 2017-06-09 20:57:38 +00:00
po Regenerate .pot files. 2017-05-01 23:28:02 +01:00
ChangeLog Add support for mutually-incompatible fix-it hints 2017-06-09 20:57: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
charset.c
config.in
configure
configure.ac
directives-only.c
directives.c
errors.c
expr.c
files.c
identifiers.c
init.c * init.c (cpp_init_builtins): Update __cplusplus for C++17. 2017-03-16 17:16:39 -04:00
internal.h
lex.c libcpp: add callback for comment-handling 2017-06-05 20:53:06 +00:00
line-map.c Add support for mutually-incompatible fix-it hints 2017-06-09 20:57:38 +00:00
location-example.txt
macro.c
makeucnid.c
mkdeps.c
pch.c Fix numerous typos in comments 2017-04-03 23:30:56 +01:00
symtab.c
system.h
traditional.c
ucnid.h
ucnid.tab