public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106285] Reduce visual noise and confusing grouping when printing overload candidate errors
Date: Wed, 13 Jul 2022 22:35:13 +0000	[thread overview]
Message-ID: <bug-106285-4-sL9Rkd2xp3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106285-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106285

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Re the grouping of related notes, I notice that with -fdiagnostics-format=json
there is no proper structure. All the notes are just children of the error, at
the same level. So the nesting is something like:

error: no matching function for call to ... {
  location of failed call site,
  candidate: decl,
  reason for failure,
  location of decl,
  candidate: decl,
  reason for failure,
  location of decl,
  candidate: decl,
  reason for failure,
  location of decl,
}

Ideally we'd have this nesting:

error: no matching function for call to ... {
  location of failed call site,
  candidate: decl {
    reason for failure,
    location of decl
  },
  candidate: decl {
    reason for failure,
    location of decl
  },
  candidate: decl {
    reason for failure,
    location of decl
  },
}

i.e. the error would have the candidates as direct children, but then the
locations and failure reason for each candidate would be children of the
candidate.

This would allow IDEs to group the info about each candidate and optionally
collapse it. With the current (lack of) structure that's not possible. Every
note is at the same level and there's no indication which ones are related to
each other.

      parent reply	other threads:[~2022-07-13 22:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 20:11 [Bug c++/106285] New: " redi at gcc dot gnu.org
2022-07-13 20:12 ` [Bug c++/106285] " redi at gcc dot gnu.org
2022-07-13 22:01 ` mpolacek at gcc dot gnu.org
2022-07-13 22:35 ` redi at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106285-4-sL9Rkd2xp3@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).