Go to file
David Malcolm 64ea27f0d2 Handle very long lines when printing fix-it hints
When fixing PR c/82050 I noticed a bug in how we print fix-it hints
for very long lines: we weren't taking into account the x-offset for
the line when printing the fix-it hint.

This could lead to output where instead of printing:

foo.c:14:3944: error: etc
  = foo.field
        ^~~~~
        replacement

where the lines have been offset to start printing at about column 3900,
the "replacement" line was erroneously *not* offset, and was thus
prefixed by thousands of spaces, leading to large whitespace gaps in
the output, and the replacement failing to line up with the source to be
replaced.

Fixed thusly.

gcc/ChangeLog:
	* diagnostic-show-locus.c (layout::print_trailing_fixits): Handle
	m_x_offset.
	(layout::move_to_column): Likewise.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic-test-show-locus-bw.c
	(test_very_wide_line): Update expected output to include a
	fix-it hint.
	* gcc.dg/plugin/diagnostic-test-show-locus-color.c
	(test_very_wide_line): Likewise.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
	(test_show_locus): Add a fix-it hint to "test_very_wide_line".

From-SVN: r255219
2017-11-28 21:45:56 +00:00
config
contrib Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
fixincludes
gcc Handle very long lines when printing fix-it hints 2017-11-28 21:45:56 +00:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcpp Reject fix-it hints for various awkward boundary cases (PR c/82050) 2017-11-28 19:24:35 +00:00
libdecnumber
libffi
libgcc
libgfortran PR 53796 Improve INQUIRE(RECL=...) handling 2017-11-28 21:28:50 +02:00
libgo
libgomp
libhsail-rt
libiberty
libitm
libmpx
libobjc
liboffloadmic
libquadmath
libsanitizer
libssp
libstdc++-v3 Add std::to_address for C++2a (P0653R2) 2017-11-28 14:22:32 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ChangeLog Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
configure.ac Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS * MAINTAINERS (write after approval): Add myself. 2017-11-28 09:14:43 +01:00
Makefile.def Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
Makefile.in Remove Cilk Plus support. 2017-11-28 11:35:37 +01:00
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.