b8f564124e
Whilst investigating PR preprocessor/78324 I noticed that the substring location code currently doesn't handle raw strings correctly, by not skipping the 'R', opening quote, delimiter and opening parenthesis. For example, an attempt to underline chars 4-7 with caret at 6 of this raw string yields this erroneous output: __emit_string_literal_range (R"foo(0123456789)foo", ~~^~ With the patch, the correct range/caret is printed: __emit_string_literal_range (R"foo(0123456789)foo", ~~^~ gcc/ChangeLog: * input.c (selftest::test_lexer_string_locations_long_line): New function. (selftest::test_lexer_string_locations_raw_string_multiline): New function. (selftest::input_c_tests): Call the new functions, via for_each_line_table_case. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic-test-string-literals-1.c (test_raw_string_one_liner): New function. (test_raw_string_multiline): New function. libcpp/ChangeLog: * charset.c (cpp_interpret_string_1): Skip locations from loc_reader when advancing 'p' when handling raw strings. From-SVN: r242552 |
||
---|---|---|
.. | ||
include | ||
po | ||
aclocal.m4 | ||
ChangeLog | ||
ChangeLog.jit | ||
charset.c | ||
config.in | ||
configure | ||
configure.ac | ||
directives-only.c | ||
directives.c | ||
errors.c | ||
expr.c | ||
files.c | ||
identifiers.c | ||
init.c | ||
internal.h | ||
lex.c | ||
line-map.c | ||
location-example.txt | ||
macro.c | ||
Makefile.in | ||
makeucnid.c | ||
mkdeps.c | ||
pch.c | ||
symtab.c | ||
system.h | ||
traditional.c | ||
ucnid.h | ||
ucnid.tab |