From patchwork Sun Oct 22 20:15:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 156600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp931745vqx; Sun, 22 Oct 2023 13:15:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiJ/wPbtqWqyQ3HfTjzboowZWYkmo6xHRjNKYQqzTuhCkQdwndMWdnoizCo2eZVLVR4b8M X-Received: by 2002:ac8:5a96:0:b0:418:a80:4529 with SMTP id c22-20020ac85a96000000b004180a804529mr11351906qtc.16.1698005732090; Sun, 22 Oct 2023 13:15:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698005732; cv=pass; d=google.com; s=arc-20160816; b=bPwB4W7Ug1d8RqCoDmsbMIM2aUOSmXm2gA+7FfkAtaS8Rst6XkrCJocZp3mNbFYTAn 5k81s2Ps45rLnGRhBdx96ZHmIh9hHciFdPXfQeOtZbd8QpmWQvV8KUqF9iZpPTedZJmW fxNHoMbysFIWnwn+Zi3ogigEATATtCr/hRQlQGR5cbg8Lnj+tvKIHkoYvcS8QL85FX3g y4n/4zzj/fAYLvKlPgtAO0xjWoQz840OwpqgnypJKs/5ZFLOGC1czPOyGymvzfXhoDZZ 1qrPDZ5A9ElnYnN0JCFtxM7HZSZw5HzBUlvmnPyfhzSTm5gfD+OKIpqCo9wRrrDGtbJK CYSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=csbQEIVxE+sg0A29SJxtusOAowLKtoddQqTzJDCtMNI=; fh=1Hi9m88IqcWZGtfSxUrMGG+GBgL26N02X1SANXM6iTs=; b=vdejMlCamj2Ww5cZ+p/g5MJ5HJIK9OonNiPLe5FwYw6YAb5JgRpXjibt3zVGsUdBn2 ce661dIScMAWUiUx57rQpeVIZkkus74KvHsdm6NJjl9DADie9DI8TM3UP1l0taEwMCLt 2x/+GXQptjgdrHIYRzQjdtYHyHx5jtt6aIlZsjZFrD7l791hgqo9AoTn/O/SuKVj6Vt5 qJL9FgUrO513eBdwhtwOJ5XduBO+bRnopQnNJLAO3Tj7LVELVxrDPtrsj8Nk6zwcsktJ hMIZBVDVEOwikRewU96P6A/RPKdeBmaPGhNLUA6mqYa9tsh+toZqRt1h7Pc9yuKvZlxH YajQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f1wS8zdq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v8-20020a05622a130800b004198d026c00si4486639qtk.408.2023.10.22.13.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 13:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f1wS8zdq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D7B9B385C41F for ; Sun, 22 Oct 2023 20:15:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 C76C53858C50 for ; Sun, 22 Oct 2023 20:15:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C76C53858C50 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 C76C53858C50 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=1698005708; cv=none; b=CIMK39qpzvDguKtkuXY9kXYPX+6S8NG/ICQ4iySAC2etoj9gLAY7K17ZwPr19NLhEOKp1zM6Mt94hBEma0J8TGldxk/3yDvY1ehfjG5/2RcCTrpK8z5xljHxpWPCgaiQJ5uk5zfOuz3Lmm9hoQTtRDjDqwKqLCHugbdKf//W4AA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698005708; c=relaxed/simple; bh=cOKb/BYBpMUtKWkIXHnRkNdxhioJxWNNZRTHBWZFBZI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PvkIUJ2LosZ9kUB21y/OouAiOVI+x4JW7qhSsokjbf9y36bSUrdvpDtGrovYJwCIteDUNrKuBDHflV8T31ROFc/0rl+SesRsXwd7Tj15KNdBLtNGEduwYaXeDF3eqXBOhWBKHT0+3JbOUhTybzc0L7ZmXSU+h9tzIjq4xvXV5Ek= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698005706; 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: content-transfer-encoding:content-transfer-encoding; bh=csbQEIVxE+sg0A29SJxtusOAowLKtoddQqTzJDCtMNI=; b=f1wS8zdqzQMGkQHHI1iEu8JTtLQ8rkJFFA0jD5XPqT1OPogyOWLJFlXvx4I5sEzZYMu5w2 w35CCBTgNivK/olFjgVQSPv+qF6hob/AzMwYLJa+jO1nRE27ErZe3G5R/FTbW88BJEji7K NmSRxPFlUosi/zk97XFHnR9QcGwctKo= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-vEkwPxbrNkaqwf3LMGvyCg-1; Sun, 22 Oct 2023 16:15:05 -0400 X-MC-Unique: vEkwPxbrNkaqwf3LMGvyCg-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-778b5445527so318024885a.1 for ; Sun, 22 Oct 2023 13:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698005704; x=1698610504; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=csbQEIVxE+sg0A29SJxtusOAowLKtoddQqTzJDCtMNI=; b=BkcCeR6tci2F93cm1E8arz944zi0InLMLofK14mT0h6KwuAaBR8g5qzENWhzg2VQcP vb4YSQPKMJVRZJBJCUHNxrhPfi+QpIFl1o2q2PdYnYwua+jFqbF1eQ+fjRXezILisOBV 5A72e3Bb2PBNwxMb8RgbRHqvh2egnZ4R5OfAr1T3nsz79P4yG1h6sMbFfGJX2c69PD89 KmEefIrgF5CKfc3osJLG4QbMGxLwwcYNlk/cX0TtbbTKopqGy+hTfxFwylCxikt7G30C Aac7UmeV0P6M8gcncf92ynip2LpdjXQ1oNVcTEtNQ6pJz+h6xaCAJIl6RZQgsBlsV8LB XQLA== X-Gm-Message-State: AOJu0YyjFSaa1IW5e8HMXva19dsH0QX0xpL82kwTAJbydMGiEjy3vTq8 ilICCC3ufsz/banw9NC75no8Pxxmo40yN9cc9s8ATohsEgc7jU2eitRYOqjMCl4meMHwUN4wqfU XS1PTc+aHJpYgGBJuLfoxB+0NBD9POu5LkCJcpa3Pcm2+3O3mwbj3vaU8Sgz1KmHhTJKrv4GxEv Q= X-Received: by 2002:a05:620a:4004:b0:778:a4b4:f32b with SMTP id h4-20020a05620a400400b00778a4b4f32bmr13484987qko.34.1698005704349; Sun, 22 Oct 2023 13:15:04 -0700 (PDT) X-Received: by 2002:a05:620a:4004:b0:778:a4b4:f32b with SMTP id h4-20020a05620a400400b00778a4b4f32bmr13484966qko.34.1698005704069; Sun, 22 Oct 2023 13:15:04 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id g27-20020a05620a13db00b00767d8e12ce3sm2228612qkl.49.2023.10.22.13.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 13:15:03 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [pushed] objc++: type/expr tsubst conflation [PR111920] Date: Sun, 22 Oct 2023 16:15:00 -0400 Message-ID: <20231022201500.2802972-1-ppalka@redhat.com> X-Mailer: git-send-email 2.42.0.424.gceadf0f3cf MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780488058588528324 X-GMAIL-MSGID: 1780488058588528324 Bootstrapped and regtested on x86_64-pc-linux-gnu, pushed to trunk as obvious. -- >8 -- After r14-4796-g3e3d73ed5e85e7, tsubst_copy_and_build (now named tsubst_expr) no longer dispatches to tsubst for type trees, and callers have to do it themselves if appropriate. This patch makes some overlooked adjustments to Objective-C++-specific code paths. PR objc++/111920 gcc/cp/ChangeLog: * pt.cc (tsubst_expr) : Use tsubst instead of tsubst_expr. gcc/objcp/ChangeLog: * objcp-lang.cc (objcp_tsubst_expr) : Use tsubst instead of tsubst_expr for type operands. --- gcc/cp/pt.cc | 2 +- gcc/objcp/objcp-lang.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 210c6cb9e4d..1c1c9313118 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -20261,7 +20261,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) op1 = TREE_OPERAND (t, 0); ++cp_unevaluated_operand; ++c_inhibit_evaluation_warnings; - op1 = tsubst_expr (op1, args, complain, in_decl); + op1 = tsubst (op1, args, complain, in_decl); --cp_unevaluated_operand; --c_inhibit_evaluation_warnings; RETURN (objc_build_encode_expr (op1)); diff --git a/gcc/objcp/objcp-lang.cc b/gcc/objcp/objcp-lang.cc index 5b04cd66290..ee39aece848 100644 --- a/gcc/objcp/objcp-lang.cc +++ b/gcc/objcp/objcp-lang.cc @@ -66,8 +66,14 @@ objcp_tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) RECURSE (TREE_OPERAND (t, 2)), NULL); case CLASS_REFERENCE_EXPR: - return objc_get_class_reference - (RECURSE (TREE_OPERAND (t, 0))); + { + tree ident = TREE_OPERAND (t, 0); + if (TYPE_P (ident)) + ident = tsubst (ident, args, complain, in_decl); + else + ident = RECURSE (ident); + return objc_get_class_reference (ident); + } default: break;