public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Sam James <sam@gentoo.org>, Eric Gallager <egall@gwmail.gwu.edu>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: provide #include hint for missing includes [PR110164]
Date: Thu, 15 Jun 2023 07:54:13 -0400	[thread overview]
Message-ID: <7198bdfadb86de4d8f6492bd1e81bd3e26d677bb.camel@redhat.com> (raw)
In-Reply-To: <87o7lhv9h8.fsf@gentoo.org>

On Thu, 2023-06-15 at 01:43 +0100, Sam James wrote:
> 
> Eric Gallager via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> 
> > On Wed, Jun 14, 2023 at 8:29 PM David Malcolm via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> > > 
> > > PR c++/110164 notes that in cases where we have a forward decl
> > > of a std library type such as:
> > > 
> > > std::array<int, 10> x;
> > > 
> > > we omit this diagnostic:
> > > 
> > > error: aggregate ‘std::array<int, 10> x’ has incomplete type and
> > > cannot be defined
> > > 
> > > This patch adds this hint to the diagnostic:
> > > 
> > > note: ‘std::array’ is defined in header ‘<array>’; this is
> > > probably fixable by adding ‘#include <array>’
> > > 
> > 
> > ..."probably"?
> > 
> 
> Right now, our fixit says:
> ```
> /tmp/foo.c:1:1: note: ‘time_t’ is defined in header ‘<ctime>’; did
> you forget to ‘#include <ctime>’?
> ```
> 
> We should probably use the same phrasing for consistency?

It's using the same phrasing (it's calling the same function); I
changed the wording recently, in r14-1798-g7474c46cf2d371:
  https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621607.html

I used "probably" because there's no guarantee it will fix things (e.g.
if the user has non-standard headers).

Dave


  reply	other threads:[~2023-06-15 11:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  0:28 David Malcolm
2023-06-15  0:36 ` Eric Gallager
2023-06-15  0:43   ` Sam James
2023-06-15 11:54     ` David Malcolm [this message]
2023-06-15 12:11       ` Sam James
2023-06-21 20:44 ` PING: " David Malcolm
2023-06-22 15:50   ` Marek Polacek
2023-06-23 16:08     ` Jason Merrill
2023-06-23 22:01       ` [pushed] " David Malcolm

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=7198bdfadb86de4d8f6492bd1e81bd3e26d677bb.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=egall@gwmail.gwu.edu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sam@gentoo.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).