diff options
author | Lewis Hyatt <lhyatt@gmail.com> | 2022-07-07 13:59:27 -0400 |
---|---|---|
committer | Lewis Hyatt <lhyatt@gmail.com> | 2022-07-08 09:43:33 -0400 |
commit | 2bd15617e73acf76207127e5580cd10b1fab91a5 (patch) | |
tree | 35be9178e2ae2b13bc5a7c6bf4ff695c2f2f565e /gcc/expr.cc | |
parent | 6da7f7c5ac03f85a753989712588511e5f56e73d (diff) | |
download | gcc-2bd15617e73acf76207127e5580cd10b1fab91a5.zip gcc-2bd15617e73acf76207127e5580cd10b1fab91a5.tar.gz gcc-2bd15617e73acf76207127e5580cd10b1fab91a5.tar.bz2 |
diagnostics: Make line-ending logic consistent with libcpp [PR91733]
libcpp recognizes a lone \r as a valid line ending, so the infrastructure
for retrieving source lines to be output in diagnostics needs to do the
same. This patch fixes file_cache_slot::get_next_line() accordingly so that
diagnostics display the correct part of the source when \r line endings are in
use.
gcc/ChangeLog:
PR preprocessor/91733
* input.cc (find_end_of_line): New helper function.
(file_cache_slot::get_next_line): Recognize \r as a line ending.
* diagnostic-show-locus.cc (test_escaping_bytes_1): Adapt selftest
since \r will now be interpreted as a line-ending.
gcc/testsuite/ChangeLog:
PR preprocessor/91733
* c-c++-common/pr91733.c: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions