diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 409e9813387..cf0421880c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-01-15 David Malcolm + + PR diagnostic/68899 + * diagnostic-show-locus.c (layout::print_source_line): Move x + offset of line until after call to + get_line_width_without_trailing_whitespace. + 2016-01-15 Jeff Law PR tree-optimization/69270 diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c index 3ef00525ed8..e32325486af 100644 --- a/gcc/diagnostic-show-locus.c +++ b/gcc/diagnostic-show-locus.c @@ -524,14 +524,13 @@ layout::print_source_line (int row, line_bounds *lbounds_out) if (!line) return false; - line += m_x_offset; - m_colorizer.set_normal_text (); /* We will stop printing the source line at any trailing whitespace. */ line_width = get_line_width_without_trailing_whitespace (line, line_width); + line += m_x_offset; pp_space (m_pp); int first_non_ws = INT_MAX;