]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/pretty-print.h
PR other/69006: fix extra newlines after diagnostics
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jan 2016 17:08:12 +0000 (17:08 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jan 2016 17:08:12 +0000 (17:08 +0000)
commit3752e5b1cc45b0f6b09b4958959582999b923e68
treeb1f95695dbde83aeccf5ef984f65ac1d0f987b81
parent4176ce096510479b797ea78d60ec753e340b32dc
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232837 138bc75d-0d04-0410-961f-82ee72b054a4
19 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/diagnostic-show-locus.c
gcc/diagnostic.c
gcc/diagnostic.h
gcc/fortran/ChangeLog
gcc/fortran/error.c
gcc/pretty-print.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/timevar1.C
gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-color.c
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
gcc/testsuite/gcc.dg/unroll-2.c
gcc/testsuite/gfortran.dg/implicit_class_1.f90
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/multiline.exp