gcc/libcpp
David Malcolm c471c6edcb diagnostics: fix end-points of ranges within macros (PR c++/79300)
gcc/ChangeLog:
	PR c++/79300
	* diagnostic-show-locus.c (layout::layout): Use start and finish
	spelling location for the start and finish of each range.
	* genmatch.c (linemap_client_expand_location_to_spelling_point):
	Add unused aspect param.
	* input.c (expand_location_1): Add "aspect" param, and use it
	to access the correct part of the location.
	(expand_location): Pass LOCATION_ASPECT_CARET to new param of
	expand_location_1.
	(expand_location_to_spelling_point): Likewise.
	(linemap_client_expand_location_to_spelling_point): Add "aspect"
	param, and pass it to expand_location_1.

gcc/testsuite/ChangeLog:
	PR c++/79300
	* c-c++-common/Wmisleading-indentation-3.c (fn_14): Update
	expected underlining within macro expansion.
	* c-c++-common/pr70264.c: Likewise.
	* g++.dg/plugin/diagnostic-test-expressions-1.C
	(test_within_macro_1): New test.
	(test_within_macro_2): Likewise.
	(test_within_macro_3): Likewise.
	(test_within_macro_4): Likewise.
	* gcc.dg/format/diagnostic-ranges.c (test_macro_3): Update
	expected underlining within macro expansion.
	(test_macro_4): Likewise.
	* gcc.dg/plugin/diagnostic-test-expressions-1.c
	(test_within_macro_1): New test.
	(test_within_macro_2): Likewise.
	(test_within_macro_3): Likewise.
	(test_within_macro_4): Likewise.
	* gcc.dg/spellcheck-fields-2.c (test_macro): Update expected
	underlining within macro expansion.

libcpp/ChangeLog:
	PR c++/79300
	* include/line-map.h (enum location_aspect): New enum.
	(linemap_client_expand_location_to_spelling_point): Add
	enum location_aspect param.
	* line-map.c (rich_location::get_expanded_location): Update for
	new param of linemap_client_expand_location_to_spelling_point.
	(rich_location::maybe_add_fixit): Likewise.
	(fixit_hint::affects_line_p): Likewise.

From-SVN: r250022
2017-07-06 14:17:24 +00:00
..
include diagnostics: fix end-points of ranges within macros (PR c++/79300) 2017-07-06 14:17:24 +00:00
po Regenerate .pot files. 2017-05-01 23:28:02 +01:00
aclocal.m4
ChangeLog diagnostics: fix end-points of ranges within macros (PR c++/79300) 2017-07-06 14:17:24 +00:00
ChangeLog.jit
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 diagnostics: fix end-points of ranges within macros (PR c++/79300) 2017-07-06 14:17:24 +00:00
location-example.txt
macro.c
Makefile.in
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