public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Better location info for "incomplete type" error msg (PR c/70756)
Date: Wed, 04 May 2016 00:05:00 -0000	[thread overview]
Message-ID: <57293CDB.6040204@redhat.com> (raw)
In-Reply-To: <20160503112707.GH5348@redhat.com>

On 05/03/2016 07:27 AM, Marek Polacek wrote:
> On Mon, May 02, 2016 at 01:34:30PM -0400, Jason Merrill wrote:
>> On 05/02/2016 12:41 PM, Marek Polacek wrote:
>>> On Fri, Apr 29, 2016 at 04:04:13PM -0400, Jason Merrill wrote:
>>>> On 04/28/2016 11:59 AM, Marek Polacek wrote:
>>>>> 3) for the C++ FE I used a macro so that I don't have to change all the
>>>>>       cxx_incomplete_type_error calls now,
>>>>
>>>> How about an inline overload, instead?
>>>
>>> I realized the macro was already there, but inline overloads should probably
>>> be preferred these days.  So I used them instead.
>>>
>>>> It seems sad to discard the location information; could we pass it into
>>>> cxx_incomplete_type_diagnostic?
>>>
>>> I suppose I can, though it required another inline overload.  I'm not sure
>>> if the patch will make the C++ diagnostics about incomplete types better,
>>> most likely not :/.
>>> +inline void
>>> +cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
>>> +				diagnostic_t diag_kind)
>>> +{
>>> +  cxx_incomplete_type_diagnostic (input_location, value, type, diag_kind);
>>> +}
>>> +
>>
>> ...
>>
>>> -cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
>>> -				diagnostic_t diag_kind)
>>> +cxx_incomplete_type_diagnostic (location_t loc, const_tree value,
>>>
>>> -  location_t loc = EXPR_LOC_OR_LOC (value, input_location);
>>
>> Shouldn't we use EXPR_LOC_OR_LOC in the inline?
>
> That, I suppose, is a good idea ;).  Thus:

Looks good.

But I don't see a C++ testcase; can the test go into c-c++-common?

Jason


  reply	other threads:[~2016-05-04  0:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 15:59 Marek Polacek
2016-04-29 20:04 ` Jason Merrill
2016-05-02 16:41   ` Marek Polacek
2016-05-02 17:34     ` Jason Merrill
2016-05-03 11:27       ` Marek Polacek
2016-05-04  0:05         ` Jason Merrill [this message]
2016-05-04 13:00           ` Marek Polacek
2016-05-04 15:53             ` Jason Merrill
2016-05-05 14:22               ` Marek Polacek
2016-05-12 10:37                 ` Marek Polacek
2016-05-12 15:09                 ` Jason Merrill

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=57293CDB.6040204@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=polacek@redhat.com \
    /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).