From 00b0c19b4bbfa483925a177ed3e6ce2e1f42444b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Wed, 13 May 2009 23:17:55 +0000 Subject: re PR preprocessor/36674 (#include location is offset by one row in errors from preprocessed files) 2009-05-14 Manuel Lopez-Ibanez PR cpp/36674 libcpp/ * directives (do_linemarker): Compensate for the increment in location that occurs when we reach the end of line. * files (_cpp_stack_include): Mention _cpp_find_file in the comment. testsuite/ * gcc.dg/cpp/pr36674.i: New. From-SVN: r147504 --- libcpp/directives.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libcpp/directives.c') diff --git a/libcpp/directives.c b/libcpp/directives.c index e71efb2..74644ff 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -1004,6 +1004,14 @@ do_linemarker (cpp_reader *pfile) } skip_rest_of_line (pfile); + + /* Compensate for the increment in linemap_add that occurs in + _cpp_do_file_change. We're currently at the start of the line + *following* the #line directive. A separate source_location for this + location makes no sense (until we do the LC_LEAVE), and + complicates LAST_SOURCE_LINE_LOCATION. */ + pfile->line_table->highest_location--; + _cpp_do_file_change (pfile, reason, new_file, new_lineno, new_sysp); } -- cgit v1.1