This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/69006] [6 Regression] Extraneous newline emitted between error messages in GCC 6
- From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Jan 2016 17:08:44 +0000
- Subject: [Bug other/69006] [6 Regression] Extraneous newline emitted between error messages in GCC 6
- Auto-submitted: auto-generated
- References: <bug-69006-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69006
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Author: dmalcolm
Date: Tue Jan 26 17:08:12 2016
New Revision: 232837
URL: https://gcc.gnu.org/viewcvs?rev=232837&root=gcc&view=rev
Log:
PR other/69006: fix extra newlines after diagnostics
gcc/c-family/ChangeLog:
PR other/69006
* c-opts.c (c_diagnostic_finalizer): Replace invocation of
pp_newline_and_flush with pp_flush.
gcc/cp/ChangeLog:
PR other/69006
* error.c (print_instantiation_partial_context_line): Add missing
newlines from output for the t == NULL case.
(print_instantiation_partial_context): Remove call to pp_newline.
gcc/ChangeLog:
PR other/69006
* diagnostic-show-locus.c (layout::print_source_line): Replace
call to pp_newline with call to layout::print_newline.
(layout::print_annotation_line): Likewise.
(layout::move_to_column): Likewise.
(layout::print_any_fixits): After printing any fixits, print a
trailing newline, if necessary.
(layout::print_newline): New method, resetting any colorization
before a newline.
(diagnostic_show_locus): Move the pp_newline to before the
early bailout. Remove dummy block enclosing the layout instance.
* diagnostic.c (default_diagnostic_finalizer): Replace invocation
of pp_newline_and_flush with pp_flush.
(diagnostic_append_note): Delete use of pp_newline.
(diagnostic_append_note_at_rich_loc): Delete.
* diagnostic.h (diagnostic_append_note_at_rich_loc): Delete.
* pretty-print.h (output_buffer_append_r): Reset buff->line_length
when newline characters are added to the buffer.
gcc/fortran/ChangeLog:
PR other/69006
* error.c (gfc_diagnostic_starter): Delete use of pp_newline.
gcc/testsuite/ChangeLog:
PR other/69006
* g++.dg/ext/timevar1.C: Add dg-allow-blank-lines-in-output
directive.
* gcc.dg/plugin/diagnostic-test-show-locus-color.c: Update
expected multiline output to reflect the colorization being
disabled before newlines.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
(custom_diagnostic_finalizer): Replace call to
pp_newline_and_flush with call to pp_flush.
* gcc.dg/unroll-2.c: Add dg-allow-blank-lines-in-output directive.
* gfortran.dg/implicit_class_1.f90: Likewise.
* lib/gcc-dg.exp (allow_blank_lines): New global.
(dg-allow-blank-lines-in-output): New procedure.
(gcc-dg-prune): Complain about blank lines in the output, unless
dg-allow-blank-lines-in-output was called.
* lib/multiline.exp (_build_multiline_regex): Only support
arbitrary followup text for non-blank-lines, not for blank lines.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-opts.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/error.c
trunk/gcc/diagnostic-show-locus.c
trunk/gcc/diagnostic.c
trunk/gcc/diagnostic.h
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/error.c
trunk/gcc/pretty-print.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/ext/timevar1.C
trunk/gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-color.c
trunk/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
trunk/gcc/testsuite/gcc.dg/unroll-2.c
trunk/gcc/testsuite/gfortran.dg/implicit_class_1.f90
trunk/gcc/testsuite/lib/gcc-dg.exp
trunk/gcc/testsuite/lib/multiline.exp