[Diagnostic Patch] don't print column zero
authorNathan Sidwell <nathan@gcc.gnu.org>
Mon, 13 Nov 2017 15:32:34 +0000 (15:32 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 13 Nov 2017 15:32:34 +0000 (15:32 +0000)
commit101e910b3a59d878b21afadf0d23330d45d57b73
tree3e25421923a0a38b77ceb7eb0be88159d7a33931
parent7ccdf51f87eb837a3b9e086b5ef07c0b150a980f
[Diagnostic Patch] don't print column zero

https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01911.html
* diagnostic.c (maybe_line_and_column): New.
(diagnostic_get_location_text): Use it.
(diagnostic_report_current_module): Likewise.
(test_diagnostic_get_location_text): Add tests.

* lib/gcc-dg.exp (process-message): Use -: for no column.
* c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Mark elided
column messages.
* c-c++-common/cpp/pr58844-1.c: Likewise.
* c-c++-common/cpp/pr58844-2.c: Likewise.
* c-c++-common/cpp/warning-zero-location.c: Likewise.
* g++.dg/diagnostic/pr77949.C: Likewise.
* g++.dg/gomp/macro-4.C: Likewise.
* gcc.dg/Wunknownprag.c: Likewise.
* gcc.dg/builtin-redefine.c: Likewise.
* gcc.dg/cpp/Wunknown-pragmas-1.c: Likewise.
* gcc.dg/cpp/Wunused.c: Likewise.
* gcc.dg/cpp/misspelled-directive-1.c: Likewise.
* gcc.dg/cpp/redef2.c: Likewise.
* gcc.dg/cpp/redef3.c: Likewise.
* gcc.dg/cpp/redef4.c: Likewise.
* gcc.dg/cpp/trad/Wunused.c: Likewise.
* gcc.dg/cpp/trad/argcount.c: Likewise.
* gcc.dg/cpp/trad/comment-3.c: Likewise.
* gcc.dg/cpp/trad/comment.c: Likewise.
* gcc.dg/cpp/trad/defined.c: Likewise.
* gcc.dg/cpp/trad/directive.c: Likewise.
* gcc.dg/cpp/trad/funlike-3.c: Likewise.
* gcc.dg/cpp/trad/funlike.c: Likewise.
* gcc.dg/cpp/trad/literals-2.c: Likewise.
* gcc.dg/cpp/trad/macro.c: Likewise.
* gcc.dg/cpp/trad/pr65238-4.c: Likewise.
* gcc.dg/cpp/trad/recurse-1.c: Likewise.
* gcc.dg/cpp/trad/recurse-2.c: Likewise.
* gcc.dg/cpp/trad/redef2.c: Likewise.
* gcc.dg/cpp/ucnid-11.c: Likewise.
* gcc.dg/cpp/unc1.c: Likewise.
* gcc.dg/cpp/unc2.c: Likewise.
* gcc.dg/cpp/unc3.c: Likewise.
* gcc.dg/cpp/unc4.c: Likewise.
* gcc.dg/cpp/undef2.c: Likewise.
* gcc.dg/cpp/warn-redefined-2.c: Likewise.
* gcc.dg/cpp/warn-redefined.c: Likewise.
* gcc.dg/cpp/warn-unused-macros-2.c: Likewise.
* gcc.dg/cpp/warn-unused-macros.c: Likewise.
* gcc.dg/empty-source-2.c: Likewise.
* gcc.dg/empty-source-3.c: Likewise.
* gcc.dg/gomp/macro-4.c: Likewise.
* gcc.dg/noncompile/pr35447-1.c: Likewise.
* gcc.dg/plugin/location-overflow-test-1.c: Likewise.
* gcc.dg/pr20245-1.c: Likewise.
* gcc.dg/pr28419.c: Likewise.
* gcc.dg/rtl/truncated-rtl-file.c: Likewise.
* gcc.dg/unclosed-init.c: Likewise.

From-SVN: r254691
51 files changed:
gcc/ChangeLog
gcc/diagnostic.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c
gcc/testsuite/c-c++-common/cpp/pr58844-1.c
gcc/testsuite/c-c++-common/cpp/pr58844-2.c
gcc/testsuite/c-c++-common/cpp/warning-zero-location.c
gcc/testsuite/g++.dg/diagnostic/pr77949.C
gcc/testsuite/g++.dg/gomp/macro-4.C
gcc/testsuite/gcc.dg/Wunknownprag.c
gcc/testsuite/gcc.dg/builtin-redefine.c
gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c
gcc/testsuite/gcc.dg/cpp/Wunused.c
gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c
gcc/testsuite/gcc.dg/cpp/redef2.c
gcc/testsuite/gcc.dg/cpp/redef3.c
gcc/testsuite/gcc.dg/cpp/redef4.c
gcc/testsuite/gcc.dg/cpp/trad/Wunused.c
gcc/testsuite/gcc.dg/cpp/trad/argcount.c
gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
gcc/testsuite/gcc.dg/cpp/trad/comment.c
gcc/testsuite/gcc.dg/cpp/trad/defined.c
gcc/testsuite/gcc.dg/cpp/trad/directive.c
gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c
gcc/testsuite/gcc.dg/cpp/trad/funlike.c
gcc/testsuite/gcc.dg/cpp/trad/literals-2.c
gcc/testsuite/gcc.dg/cpp/trad/macro.c
gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c
gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c
gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c
gcc/testsuite/gcc.dg/cpp/trad/redef2.c
gcc/testsuite/gcc.dg/cpp/ucnid-11.c
gcc/testsuite/gcc.dg/cpp/unc1.c
gcc/testsuite/gcc.dg/cpp/unc2.c
gcc/testsuite/gcc.dg/cpp/unc3.c
gcc/testsuite/gcc.dg/cpp/unc4.c
gcc/testsuite/gcc.dg/cpp/undef2.c
gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c
gcc/testsuite/gcc.dg/cpp/warn-redefined.c
gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c
gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c
gcc/testsuite/gcc.dg/empty-source-2.c
gcc/testsuite/gcc.dg/empty-source-3.c
gcc/testsuite/gcc.dg/gomp/macro-4.c
gcc/testsuite/gcc.dg/noncompile/pr35447-1.c
gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c
gcc/testsuite/gcc.dg/pr20245-1.c
gcc/testsuite/gcc.dg/pr28419.c
gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c
gcc/testsuite/gcc.dg/unclosed-init.c
gcc/testsuite/lib/gcc-dg.exp