From 44714d8ce1ec1b5ac5dc9a2ed3d57713b9253e81 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 8 Feb 2016 17:33:45 +0000 Subject: PR preprocessor/69664: fix rich_location::override_column gcc/testsuite/ChangeLog: PR preprocessor/69664 * gcc.dg/cpp/trad/comment-2.c: Add expected column number. * gcc.dg/cpp/warn-comments.c: Likewise. libcpp/ChangeLog: PR preprocessor/69664 * errors.c (cpp_diagnostic_with_line): Only call rich_location::override_column if the column is non-zero. * line-map.c (rich_location::override_column): Update columns within m_ranges[0]. Add assertions to verify that doing so is sane. From-SVN: r233223 --- libcpp/errors.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libcpp/errors.c') diff --git a/libcpp/errors.c b/libcpp/errors.c index d92b386..9847378 100644 --- a/libcpp/errors.c +++ b/libcpp/errors.c @@ -141,7 +141,8 @@ cpp_diagnostic_with_line (cpp_reader * pfile, int level, int reason, if (!pfile->cb.error) abort (); rich_location richloc (pfile->line_table, src_loc); - richloc.override_column (column); + if (column) + richloc.override_column (column); ret = pfile->cb.error (pfile, level, reason, &richloc, _(msgid), ap); return ret; -- cgit v1.1