]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: suppress "note: " prefix in nested diagnostics [PR116253]
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 11 Dec 2024 15:26:17 +0000 (10:26 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 11 Dec 2024 15:26:17 +0000 (10:26 -0500)
commit7435d1dbae8ae1db239228811b1e1f2452674704
tree913b9f898c967122bee04606229edd07ec0ba623
parentd3dd24acd74605488ebdb93c8b95da958053d43f
diagnostics: suppress "note: " prefix in nested diagnostics [PR116253]

This patch is a followup to:
  "c++: use diagnostic nesting [PR116253]"

This patch tweaks how text output with experimental-nesting=yes
prints nested diagnostics, by omitting the leading "note: " from
nested notes.

This reduces the amount of visual cruft the user has to ignore when
reading C++ template errors; see the examples in the testsuite.

This doesn't affect the output for users who have not opted-in
to nested diagnostic-printing.

gcc/ChangeLog:
PR other/116253
* diagnostic-format-text.cc (build_prefix): Don't add the
"note: " prefix when showing nested diagnostics.

gcc/testsuite/ChangeLog:
PR other/116253
* g++.dg/concepts/nested-diagnostics-1-truncated.C: Update
expected output.
* g++.dg/concepts/nested-diagnostics-1.C: Likewise.
* g++.dg/concepts/nested-diagnostics-2.C: Likewise.
* gcc.dg/plugin/diagnostic-test-nesting-text-indented-show-levels.c:
Likewise.
* gcc.dg/plugin/diagnostic-test-nesting-text-indented-unicode.c:
Likewise.
* gcc.dg/plugin/diagnostic-test-nesting-text-indented.c: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostic-format-text.cc
gcc/testsuite/g++.dg/concepts/nested-diagnostics-1-truncated.C
gcc/testsuite/g++.dg/concepts/nested-diagnostics-1.C
gcc/testsuite/g++.dg/concepts/nested-diagnostics-2.C
gcc/testsuite/gcc.dg/plugin/diagnostic-test-nesting-text-indented-show-levels.c
gcc/testsuite/gcc.dg/plugin/diagnostic-test-nesting-text-indented-unicode.c
gcc/testsuite/gcc.dg/plugin/diagnostic-test-nesting-text-indented.c