From patchwork Tue Sep 19 18:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 142053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3602007vqi; Tue, 19 Sep 2023 11:41:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWQVwsaHlt1/MWnGWNyiDEaA9BHtSfG9d0Hxa4af69h29Qa4dQe2kU+3fhuBYnviE5fmqI X-Received: by 2002:a2e:b713:0:b0:2b9:aa4d:3728 with SMTP id j19-20020a2eb713000000b002b9aa4d3728mr218442ljo.29.1695148863216; Tue, 19 Sep 2023 11:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695148863; cv=none; d=google.com; s=arc-20160816; b=usPmfSPGACWMtMTQW0rKGp5XiqTYReakOvf9IIrDq2t5TfigEE+r5M/2AK6BXnTvqw Gysti2DDplepPdK3QV2QnLnlVH7OBcxceBezg4SNfU7LWkWF5+j+8Ea6B5uhs3+6Fc4O YYmtQSS0aHWZjxYb0XEh85QFWWD/sHP/kvcTENLuzNEtuXq2/OKlt8MgqhofihcmgXhT EsBfkX42rq5IhkNHQwuxYd7j0XNX5WtjKj00KkI3b9d4tKTj/ZxAasUNxTfirs6az35P tKynwCtt/OR9UDTPG65biuw4vz31wdK305LeVOD5GPe2U2sf7leBcftK4enfhQA3kUiI jM6A== ARC-Message-Signature: i=1; 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 :dmarc-filter:delivered-to; bh=8iZ6nT4g+kj2rnPBT3WQL6HpOU8ySzrRf8Gs8Kugccg=; fh=1Hi9m88IqcWZGtfSxUrMGG+GBgL26N02X1SANXM6iTs=; b=yEWMAAUSLXRFORCJUihd0Hnul/k2a8Bne7aA5kgDxG8T1D7B5labbNX87MLvN3859i +Cm7F6iW7z2SFnDyhrfCq+i92vjp5VS72XfKXXLrYg8iiQDQoSMpbFrWehFLdYm6DTNv ozR+hKxTDeuA2p/KNMDWZe6sVCY/Rk8iHrC9+8rz5Y6hxpPG6XtwgGNuB7Y16HON6aON YnZuwQLbzDMuNaBaA/U709Fdmf/AnLRrtkspmlb3KY+cQJ1xVy09QxBQbiq6d/BioCRb aSU//DXUNO4OwpmnzEzQN6CIH4IbowCmTWcxb/cKRmn6bnmPOq5/bJDsCNxfpKrofcpl qvzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IppLHsC/"; 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 i26-20020a1709063c5a00b009adfbab3c27si4760763ejg.620.2023.09.19.11.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 11:41:03 -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="IppLHsC/"; 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 DC306385697F for ; Tue, 19 Sep 2023 18:40:49 +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.133.124]) by sourceware.org (Postfix) with ESMTPS id 2D9713858D20 for ; Tue, 19 Sep 2023 18:40:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D9713858D20 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=1695148820; 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=8iZ6nT4g+kj2rnPBT3WQL6HpOU8ySzrRf8Gs8Kugccg=; b=IppLHsC/a8JxwCxcdrLtrh87RaEltG0QuBQDRyE3maZ8SlXncwSf+JdJt2EyvemsEohKw3 WCJNDNiOObCJB9FzoVJYY5u7r0BmUcKB82cOIJGEIM19AbSkuFbGiECb9M/4Ngqzc3NZTm 85EiinoNLMrDVpYDbky6KO+25ziBAEo= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-c4xK6JemMECCycGQkKpG3g-1; Tue, 19 Sep 2023 14:40:19 -0400 X-MC-Unique: c4xK6JemMECCycGQkKpG3g-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6563eac566fso1102406d6.1 for ; Tue, 19 Sep 2023 11:40:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695148818; x=1695753618; 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=8iZ6nT4g+kj2rnPBT3WQL6HpOU8ySzrRf8Gs8Kugccg=; b=s7oIt0hcwN7NvFnD714sAEY0GWV1AOr4IyC7i/IFVGuYv/J4EpGDS2u/C7qcUYkAYY KMHBWNaHOojxhwSniEE3njxoSRfYqwq27ukAcnTjM5q0xKk79ozhn0JrO1graOu2BWvd 6oSMuKgBowZligeBQJzI5c4K2IJ/6unaF6vlSQ70jzYIi4hUaA2qZEugk1IKtSOBhtjO L8zjZGrDh7p6BfkfWmLYqKRfb60s3pLUAWII0+uc126KBNEFVJu/Rs1K8IXrC6xwmBOu 1KykJxKUrPLeet80JuxvX+M8QpFNOnFjyz/Ihk/KOGsBtgQHtPN41tjV8SlXLxmD9ElW 3Kmw== X-Gm-Message-State: AOJu0YxcUPKLbINr4IjUIDVB3ylcUZ+iFkQUcLCmMenHBY6daHSlWdNB 0GdKNtNutbysSTHoTeweSxdSyuX1uDitFxcoChbgRSvsx+Wj8sf52eQsNZTv66TZB5QyU+CU+EW odUJ5+rl1RJLIljgP7Bb4dYtpzdWFPtx5w2BfWix3Lrv4cXPRB0MCR9OuaVDXNuJ2BCw2baK1Z1 U= X-Received: by 2002:a05:6214:268d:b0:63f:8839:658 with SMTP id gm13-20020a056214268d00b0063f88390658mr4363187qvb.1.1695148818755; Tue, 19 Sep 2023 11:40:18 -0700 (PDT) X-Received: by 2002:a05:6214:268d:b0:63f:8839:658 with SMTP id gm13-20020a056214268d00b0063f88390658mr4363167qvb.1.1695148818426; Tue, 19 Sep 2023 11:40:18 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id l25-20020a0c9799000000b006516780a0a5sm2465818qvd.117.2023.09.19.11.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 11:40:18 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [pushed] c++: fix cxx_print_type's template-info dumping Date: Tue, 19 Sep 2023 14:40:15 -0400 Message-ID: <20230919184016.1059841-1-ppalka@redhat.com> X-Mailer: git-send-email 2.42.0.216.gbda494f404 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_H3, 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: 1777492414546498438 X-GMAIL-MSGID: 1777492414546498438 Tested on x86_64-pc-linux-gnu, pushed to trunk as obvious. -- >8 -- Unlike DECL_TEMPLATE_INFO which is stored in DECL_LANG_SPECIFIC, TYPE_TEMPLATE_INFO isn't stored in TYPE_LANG_SPECIFIC, so we don't need to check for both in cxx_print_type. This fixes dumping the template-info of ENUMERAL_TYPE and BOUND_TEMPLATE_TEMPLATE_PARM, which seem to never have TYPE_LANG_SPECIFIC. gcc/cp/ChangeLog: * ptree.cc (cxx_print_type): Remove TYPE_LANG_SPECIFIC test guarding TYPE_TEMPLATE_INFO. --- gcc/cp/ptree.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ptree.cc b/gcc/cp/ptree.cc index b4001486701..32c5b5280dc 100644 --- a/gcc/cp/ptree.cc +++ b/gcc/cp/ptree.cc @@ -141,9 +141,8 @@ cxx_print_decl (FILE *file, tree node, int indent) void cxx_print_type (FILE *file, tree node, int indent) { - if (TYPE_LANG_SPECIFIC (node) - && TYPE_TEMPLATE_INFO (node)) - print_node (file, "template-info", TYPE_TEMPLATE_INFO (node), indent + 4); + if (tree ti = TYPE_TEMPLATE_INFO (node)) + print_node (file, "template-info", ti, indent + 4); switch (TREE_CODE (node)) {