From: Jason Merrill <jason@redhat.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH for c++/88184, ICE when treating name as template-name
Date: Thu, 29 Nov 2018 21:04:00 -0000 [thread overview]
Message-ID: <5e3b0168-e98b-b9ac-e4da-a939b445ab98@redhat.com> (raw)
In-Reply-To: <20181129182828.GH3269@redhat.com>
On 11/29/18 1:28 PM, Marek Polacek wrote:
> On Wed, Nov 28, 2018 at 10:34:11PM -0500, Jason Merrill wrote:
>> On 11/28/18 10:48 AM, Marek Polacek wrote:
>>> Since P0846R0 was implemented, a name will be treated as a template-name when
>>> it is an unqualified-id followed by a < and name lookup finds either one or
>>> more functions or finds nothing, in order to potentially cause ADL to be performed.
>>>
>>> In this case, we had
>>>
>>> f<T> ();
>>>
>>> where we'd found a decl for f (not a TEMPLATE_DECL) and < follows.
>>
>> From the backtrace in the PR, it seems as though we're treating f<T> as
>> non-dependent, which is wrong. type_dependent_expression_p only looks at
>> the arguments of a TEMPLATE_ID_EXPR if it has unknown_type_node, so we
>> probably want to give it that type.
>
> That was my first attempt but it was crashing everywhere, so I abandoned it.
> But I was setting unknown_type_node in cp_parser_template_name whereas this
> patch sets it in cp_parser_postfix_expression, which works and is arguably
> better because it reuses the diagnostic in finish_call_expr.
Would it work for lookup_template_function to always use unknown_type_node?
Jason
next prev parent reply other threads:[~2018-11-29 21:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 15:48 Marek Polacek
2018-11-29 3:34 ` Jason Merrill
2018-11-29 18:28 ` Marek Polacek
2018-11-29 21:04 ` Jason Merrill [this message]
2018-12-04 17:27 ` Marek Polacek
2018-12-04 19: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=5e3b0168-e98b-b9ac-e4da-a939b445ab98@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).