forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249403 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
dmalcolm
committed
Jun 20, 2017
1 parent
199666f
commit c2403f3
Showing
5 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
2017-06-20 David Malcolm <[email protected]> | ||
|
||
* diagnostic-show-locus.c | ||
(selftest::test_fixit_deletion_affecting_newline): New function. | ||
(selftest::diagnostic_show_locus_c_tests): Call it. | ||
|
||
2017-06-20 Andreas Schwab <[email protected]> | ||
|
||
PR target/80970 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
2017-06-20 David Malcolm <[email protected]> | ||
|
||
* 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. | ||
|
||
2017-06-09 David Malcolm <[email protected]> | ||
|
||
* include/line-map.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters