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: 1853332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=f1wS8zdq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SD8h95HlGz23jV for ; Mon, 23 Oct 2023 07:15:21 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB1EB3853526 for ; Sun, 22 Oct 2023 20:15:19 +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-Google-Smtp-Source: AGHT+IFlqDAheB52DzU9x2UPX4/dAjLSl9g/4DLFQyb0NEvaBYb+4PjaW8+kRQTL+AeByybD5NHGgw== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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;