From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id DCFA33857710 for ; Tue, 25 Jul 2023 20:25:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCFA33857710 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690316721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NPUhqLdFsoYfmY8pZM8cZ4G6cQCqhw5DssGJtf5y4WY=; b=C2mdg7M/4UMQbxA4S++VUtiOyeKpfsC422Mfuf80pLwSd75Rar2Y82Z3t2mTNKOjnXIdWh W8YkrLck09QnCcRBTyR07Zks14rwRPE79HZ2Rt8qIovjIcCRU2RIdvyluIaDkzVLtw1Byk u57BeGecYkUCn3uIvnx+z4sG1lmRBbs= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-506A9xISMouhHP_JjU2PCQ-1; Tue, 25 Jul 2023 16:25:20 -0400 X-MC-Unique: 506A9xISMouhHP_JjU2PCQ-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-63d0eb48a3dso18010496d6.2 for ; Tue, 25 Jul 2023 13:25:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690316719; x=1690921519; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NPUhqLdFsoYfmY8pZM8cZ4G6cQCqhw5DssGJtf5y4WY=; b=JYt3jJHVuwed5Im8yn68AzuMHOCmsGlK6Ki38FrdigEFZjF5XZWNUhh0IhtzYlv13V Y07/ttYT1QjJjuzNp8+jxpJ2eS4Rrs4xcbjfqVDSDSJqSlC/bdm4W1pVyuoli28AM8fS WMfsvI8i4DjWHeSpZPOUCWUQer/eruXjqlDc1nLdEtQnDImAzqMp8oRDbdIcv9XcmjjE yTznndAyyP85EJgtokZwKGXIPUZtq1yS9mY774wx5pkxef758SQA+VG/X87XaiUNflq9 lKjEdvPHoIx5WLE50MvCYl/OymhcC5jeGeBzmr5bAMGTqfaoROiP8pdqvdE2KXsHP6Al dSjQ== X-Gm-Message-State: ABy/qLblebeJF8NwXKRWhLpp24/WHHG3pcmtZUD1y3MjdtDbiJMIw3Wn qpU7v/7DZf+Gf6je+Zl1qdeQ8fJWathI5ekYmEyImuLSRsng4L1vpotqSPq6PmOJVfmGK72gRfF mJd/QzF2LK0qv4niJaw== X-Received: by 2002:a05:6214:44:b0:63d:922:4d7d with SMTP id c4-20020a056214004400b0063d09224d7dmr71206qvr.32.1690316719522; Tue, 25 Jul 2023 13:25:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlFbPeALwVs8bxBayYqB6wo9qb7NeW2Zu/sTbenJMiABSPNprbQNtTIK02TZiCE56l8G9ujuBQ== X-Received: by 2002:a05:6214:44:b0:63d:922:4d7d with SMTP id c4-20020a056214004400b0063d09224d7dmr71198qvr.32.1690316719259; Tue, 25 Jul 2023 13:25:19 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id p17-20020a0ccb91000000b006263c531f61sm4537133qvk.24.2023.07.25.13.25.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jul 2023 13:25:18 -0700 (PDT) Message-ID: Date: Tue, 25 Jul 2023 16:25:18 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] c++: clear tf_partial et al in instantiate_template [PR108960] To: Marek Polacek , GCC Patches References: <20230725195552.1249139-1-polacek@redhat.com> From: Jason Merrill In-Reply-To: <20230725195552.1249139-1-polacek@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 7/25/23 15:55, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. > -- >8 -- > > In > we concluded that we might clear all flags except tf_warning_or_error > when performing instantiate_template. > > PR c++/108960 > > gcc/cp/ChangeLog: > > * pt.cc (lookup_and_finish_template_variable): Don't clear tf_partial > here. > (instantiate_template): Reset all complain flags except > tf_warning_or_error. > --- > gcc/cp/pt.cc | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc > index 21b08a6266a..265e2a59a52 100644 > --- a/gcc/cp/pt.cc > +++ b/gcc/cp/pt.cc > @@ -10396,12 +10396,6 @@ lookup_and_finish_template_variable (tree templ, tree targs, > tree var = lookup_template_variable (templ, targs, complain); > if (var == error_mark_node) > return error_mark_node; > - /* We may be called while doing a partial substitution, but the > - type of the variable template may be auto, in which case we > - will call do_auto_deduction in mark_used (which clears tf_partial) > - and the auto must be properly reduced at that time for the > - deduction to work. */ > - complain &= ~tf_partial; > var = finish_template_variable (var, complain); > mark_used (var); > return var; > @@ -22008,6 +22002,14 @@ instantiate_template (tree tmpl, tree orig_args, tsubst_flags_t complain) > if (tmpl == error_mark_node) > return error_mark_node; > > + /* The other flags are not relevant anymore here, especially tf_partial > + shouldn't be set. For instance, we may be called while doing a partial > + substitution of a template variable, but the type of the variable > + template may be auto, in which case we will call do_auto_deduction > + in mark_used (which clears tf_partial) and the auto must be properly > + reduced at that time for the deduction to work. */ > + complain &= tf_warning_or_error; > + > gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL); > > if (modules_p ()) > > base-commit: 6e424febfbcb27c21a7fe3a137e614765f9cf9d2