From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id C4F25385783D for ; Mon, 31 Aug 2020 19:48:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C4F25385783D Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-SL_yvJKONY2y5cOvkJXZVg-1; Mon, 31 Aug 2020 15:48:19 -0400 X-MC-Unique: SL_yvJKONY2y5cOvkJXZVg-1 Received: by mail-qk1-f198.google.com with SMTP id 139so4499879qkl.11 for ; Mon, 31 Aug 2020 12:48:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xyFLHBW5T31W1+66eGysTQXbVZpZ2eRquxSLia1XCq4=; b=kGLj+4NJyCXGVO7aQtGFTy5UFZOI8uSH9xbxltyQKqSjnA3CdMRJJ7KGcEIcwGoBp1 riEJ/XQH/Ow5s/baEpcxMoP32PEvLg86e4oPKecYYdIazr71x0lUSOn2YBwd2KodMKyH E6Fyfkaq0LgHJZbRD6pzqq56wrtOHUWAlrxf+o6kiw1vLr4GStXH730XNRu/cBwGUUw8 dFf8ab5OL/e70fD2DG5pyTVrkdVsj1Ixndpm6KqWuzqCiWwGF0Eq5qtTrwtvCBsw2Lj4 ff31RRI6REskZ+oI+qaDYSZU4SieBFa7RU2szaCKAOZHb8c+mebDdUbD3dZZaQHzp7rs hhWw== X-Gm-Message-State: AOAM531ggW0LK7WwKdQCJ8Yr2s16KfH8iIZRxVJLaZ6uORn6yiuMaOkK vh5lzobt6a7hHiJNpv7Y1qzqKVlukO4wLWDjVl73UQBzlfbce9GBmMXvqEmllTzJejH5X3/Jz4w wNiVjj3ZGNO9eOZMEUA== X-Received: by 2002:a0c:f58d:: with SMTP id k13mr2653310qvm.147.1598903298769; Mon, 31 Aug 2020 12:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxAVq7/OagEIdFgmdfNPPfEdlDBQeM3CyynWlCRwRFv37BINQ+W/YcJuJxFAI7Tt2R46mnxg== X-Received: by 2002:a0c:f58d:: with SMTP id k13mr2653287qvm.147.1598903298492; Mon, 31 Aug 2020 12:48:18 -0700 (PDT) Received: from [192.168.1.148] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id n33sm11406833qtd.43.2020.08.31.12.48.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Aug 2020 12:48:17 -0700 (PDT) Subject: Re: [PATCH] c++: Fix resolving the address of overloaded pmf [PR96647] To: Patrick Palka Cc: gcc-patches@gcc.gnu.org References: <20200828164052.2100771-1-ppalka@redhat.com> <5f76b94-415-5844-ea48-414f418b5aae@idea> From: Jason Merrill Message-ID: <6f29f830-7cc0-4f2c-0060-90d40e649b84@redhat.com> Date: Mon, 31 Aug 2020 15:48:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <5f76b94-415-5844-ea48-414f418b5aae@idea> X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2020 19:48:23 -0000 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