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 6FAFF3858D34 for ; Wed, 1 May 2024 20:40:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FAFF3858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6FAFF3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714596026; cv=none; b=UIoK7ZvWhdIyghWxAH13dmfirwDsnZTOBjV9X3T1WHFVtEd3fevr9AjL2whv04CP6ydn3xpg5NzndjnYFRKKUZGJ9K01oCTAABCZPs4uRcHM0bKwxfc7KyA8mrKFjVmG9GqXYqwmFmg73DQdq/bz7Q2Ots/AMMr4kbpAbZBm3HI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714596026; c=relaxed/simple; bh=1viyB5TxDxGcE+ggofgcB7C7TwzhviFhHKOJR5/vwwM=; h=DKIM-Signature:From:Date:To:Subject:Message-ID:MIME-Version; b=cOC9/km0YH6z/TM5m2pXTy9FkUvqj9SJJqsc54zdlfPMiRYoorEpAmsHLbKQ6OvTMqdGc6iOub6XYEW5gLd/+e5C+hkEN6qlFJyJIPo2z04sw9E9FkJrZyjxrjXN1boL+7qhdAmuMEYnNHtwOiOMUgiGNq3sZepHUGcKkxe89Fc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714596024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aGzt7S56J0CtP6sfg9qpgeOSweE+AFicRgZ/R0ySuEw=; b=J1uk+BJ1y0+PBdo/ZF2vlmCWfHv90Iabgy8EGCBSyFOVtgjdzuNg/q5OWCS+06G3QfGbmj NpAMFIeaCGwaIzJNrOBIU1RGmSd2WP/NyQikSMpXec+M7V6mPcCZdsAoel8Zq497kdTiU9 hUzpT+DEOvsw0jpHchUnxbo8IackYMw= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61--ox-8XYSOpaAemMIWEpZng-1; Wed, 01 May 2024 16:40:22 -0400 X-MC-Unique: -ox-8XYSOpaAemMIWEpZng-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-23956d37186so7298151fac.1 for ; Wed, 01 May 2024 13:40:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714596022; x=1715200822; h=mime-version:references:message-id:in-reply-to:subject:cc:to:date :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aGzt7S56J0CtP6sfg9qpgeOSweE+AFicRgZ/R0ySuEw=; b=WbzXxTjkE4raG0ECzoHBjQBvZgBH7LJdIU150sTmwhHqCa0QlgyUqjdfTKWmVIFMzb V/6x7+xsIiXwCRIzUK5qC6brJEYiBkrNlXnWDh0EWCrCEC7S5l066CXm/x2F8KRCd5Xc fH2m34iY/eXcC8J90TYbxL5fX4Ae2nFEpLLfK7CsO3UFBLcsNH2pfJcsWyYfdiAnSbtu IA/WpcPC2qhqqK2PzMxEZ7xGtSf5yBUDOYDu+RBO2d2sPMthbU/somPllzWe72YUjgwC 85K0T9Xf1eGN08Znxo9fgkfpe/YNg6foZfxYYls/SZt9VEX+zzqZiWlT6o11CansXN6i PAHA== X-Forwarded-Encrypted: i=1; AJvYcCUQ/P8Ju9ZZ/3HZfPEHKqPAhPqflwLMR6O6UXK9KuzhnsBGdtfdz6TbDcy4nHFXwI8w3+pEGJtoO9hwXjaeaBfjiY01Y57kbQ== X-Gm-Message-State: AOJu0Ywx3N2Nciw5tvx4C4h8qgKekD2JS3WBIkKB3nYgflNz+fzpemdb E9cdz82bvgxlvqYMWbU+hJcnhUZ7vZWoF+tOxJZqVY2Df7oTSgc50vCdgosMPxmxZL0A9qghQpK dKgIDU6qf5+kDZEjmMmoUDicqFAmuQrJEsbGTGyrBNhE5w1aRRNO5JZ4= X-Received: by 2002:a05:6870:3309:b0:22e:c8ea:ca06 with SMTP id x9-20020a056870330900b0022ec8eaca06mr4142789oae.17.1714596021602; Wed, 01 May 2024 13:40:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9PThQST89MPwf8NKaI6nhmlSI/+XHpvClPvffwVY9/dDgrBguNIh+95aTOqYcDMmtFk09OA== X-Received: by 2002:a05:6870:3309:b0:22e:c8ea:ca06 with SMTP id x9-20020a056870330900b0022ec8eaca06mr4142763oae.17.1714596021255; Wed, 01 May 2024 13:40:21 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id sg18-20020a05620a935200b00790fedd9262sm2464361qkn.42.2024.05.01.13.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 13:40:20 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Wed, 1 May 2024 16:40:20 -0400 (EDT) To: Jason Merrill cc: Patrick Palka , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag In-Reply-To: <0182a4aa-cb43-42ec-b8fd-c9a23424d889@redhat.com> Message-ID: <823f5898-02d1-e6a3-8e18-aa3695193a0f@idea> References: <20240202194104.317982-1-ppalka@redhat.com> <20240202194104.317982-2-ppalka@redhat.com> <1053294c-b63c-b40b-0ba2-069e2bd615c3@idea> <0182a4aa-cb43-42ec-b8fd-c9a23424d889@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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 Wed, 1 May 2024, Jason Merrill wrote: > On 5/1/24 12:41, Patrick Palka wrote: > > On Fri, 2 Feb 2024, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux, does this look like > > > an improvement? This is not a bugfix and barely related to the previous > > > patch, but the previous patch's new use of entering_scope=true motivated > > > me to submit this patch since it seems like a nice simplification. > > > > Ping, now that stage 1 is open. > > Thanks for the ping. The earlier message isn't showing up in Thunderbird for > some reason, though I see it in the gmail web interface... Ah, weird. No worries, this patch was very much stage 1 material anyway. > > > > @@ -16771,9 +16722,10 @@ tsubst (tree t, tree args, tsubst_flags_t > > > complain, tree in_decl) > > > ctx = TREE_VEC_ELT (ctx, 0); > > > } > > > else > > > - ctx = tsubst_aggr_type (ctx, args, > > > - complain | tf_qualifying_scope, > > > - in_decl, /*entering_scope=*/1); > > > + { > > > + ctx = tsubst_scope (ctx, args, complain, in_decl); > > Why is this one tsubst_scope while the others are all plain tsubst? Ah, just because the call to tsubst_aggr_type being replace passes tf_qualifying_scope already, so we might as well use tsubst_scope as shorthand. > > Do we want a tsubst_entering_scope function? Which is just shorthand for tsubst + adjust_type_for_entering_scope? Sure, though I was wondering if we eventually might want to get rid of the distinction between the primary template type A and the generic instantiation A, and we could treat this as an incremental step towards that (then we'd just eventually remove the adjust_type_for_entering_scope calls and keep the tsubst calls). > > > > + ctx = adjust_type_for_entering_scope (ctx); > >