public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Patrick Palka <ppalka@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: Fix resolving the address of overloaded pmf [PR96647]
Date: Mon, 31 Aug 2020 15:48:16 -0400	[thread overview]
Message-ID: <6f29f830-7cc0-4f2c-0060-90d40e649b84@redhat.com> (raw)
In-Reply-To: <5f76b94-415-5844-ea48-414f418b5aae@idea>

On 8/28/20 12:45 PM, Patrick Palka wrote:
> (Removing libstdc++@gcc.gnu.org from CC list)
> 
> On Fri, 28 Aug 2020, Patrick Palka wrote:
>> In resolve_address_of_overloaded_function, currently only the second
>> pass over the overload set (which considers just the function templates
>> in the overload set) checks constraints and performs return type
>> deduction when necessary.  But as the testcases below show, we need to
>> do this when considering non-template functions during the first pass,
>> too.
>>
>> Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
>>
>> gcc/cp/ChangeLog:
>>
>> 	PR c++/96647
>> 	* class.c (resolve_address_of_overloaded_function): Also check
>> 	constraints and perform return type deduction when considering
>> 	non-template functions in the overload set.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 	PR c++/96647
>> 	* g++.dg/cpp0x/auto-96647.C: New test.
>> 	* g++.dg/cpp2a/concepts-fn6.C: New test.
>> ---
>>   gcc/cp/class.c                            | 16 ++++++++++++++++
>>   gcc/testsuite/g++.dg/cpp0x/auto-96647.C   | 10 ++++++++++
>>   gcc/testsuite/g++.dg/cpp2a/concepts-fn6.C | 10 ++++++++++
>>   3 files changed, 36 insertions(+)
>>   create mode 100644 gcc/testsuite/g++.dg/cpp0x/auto-96647.C
>>   create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-fn6.C

>> +	if (undeduced_auto_decl (fn))
>> +	  {
>> +	    /* Force instantiation to do return type deduction.  */
>> +	    ++function_depth;
>> +	    instantiate_decl (fn, /*defer*/false, /*class*/false);
>> +	    --function_depth;

How about maybe_instantiate_decl instead of this hunk?  This looks like 
it could call instantiate_decl for a non-template function, which is wrong.

Jason


  reply	other threads:[~2020-08-31 19:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-28 16:40 Patrick Palka
2020-08-28 16:45 ` Patrick Palka
2020-08-31 19:48   ` Jason Merrill [this message]
2020-09-08 13:17     ` Patrick Palka
2020-09-08 20:20       ` 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=6f29f830-7cc0-4f2c-0060-90d40e649b84@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ppalka@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).