diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-02-08 17:33:45 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-02-08 17:33:45 +0000 |
commit | 44714d8ce1ec1b5ac5dc9a2ed3d57713b9253e81 (patch) | |
tree | 9fcd123fd85a32e3a218356b240e6888a8a295fa /libcpp/errors.c | |
parent | f258ad62e3ede7069fa9d3926d6377c111f9c6e5 (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.
From-SVN: r233223
Diffstat (limited to 'libcpp/errors.c')
-rw-r--r-- | libcpp/errors.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcpp/errors.c b/libcpp/errors.c index d92b38662ea..984737877be 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; |