summaryrefslogtreecommitdiff
path: root/libcpp/errors.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-08 17:33:45 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-08 17:33:45 +0000
commit86e0b129b4e7018bf7ca98a589d162aa4d0a4b76 (patch)
tree9fcd123fd85a32e3a218356b240e6888a8a295fa /libcpp/errors.c
parentdac01e13c6706b484d3ccd451b72c95710986038 (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233223 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/errors.c')
-rw-r--r--libcpp/errors.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcpp/errors.c b/libcpp/errors.c
index d92b38662eaa..984737877be5 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;