public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1185] diagnostic-show-locus: tweak rejection logic
@ 2021-06-03 14:33 David Malcolm
0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2021-06-03 14:33 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4bdc6e17c9dc621f9502a84abceb2e17ae0418f8
commit r12-1185-g4bdc6e17c9dc621f9502a84abceb2e17ae0418f8
Author: David Malcolm <dmalcolm@redhat.com>
Date: Thu Jun 3 10:32:40 2021 -0400
diagnostic-show-locus: tweak rejection logic
gcc/ChangeLog:
* diagnostic-show-locus.c (diagnostic_show_locus): Don't reject
printing the same location twice if there are fix-it hints,
multiple locations, or a label.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diff:
---
gcc/diagnostic-show-locus.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c
index 4111cd66544..24bd0313126 100644
--- a/gcc/diagnostic-show-locus.c
+++ b/gcc/diagnostic-show-locus.c
@@ -2600,9 +2600,11 @@ diagnostic_show_locus (diagnostic_context * context,
return;
/* Don't print the same source location twice in a row, unless we have
- fix-it hints. */
+ fix-it hints, or multiple locations, or a label. */
if (loc == context->last_location
- && richloc->get_num_fixit_hints () == 0)
+ && richloc->get_num_fixit_hints () == 0
+ && richloc->get_num_locations () == 1
+ && richloc->get_range (0)->m_label == NULL)
return;
context->last_location = loc;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-03 14:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 14:33 [gcc r12-1185] diagnostic-show-locus: tweak rejection logic David Malcolm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).