From patchwork Tue Jan 19 14:51:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1428667 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=T/5JedwB; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DKs7j5dnvz9sVy for ; Wed, 20 Jan 2021 01:52:16 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF4AA393D005; Tue, 19 Jan 2021 14:51:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id 38C8E393C852 for ; Tue, 19 Jan 2021 14:51:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 38C8E393C852 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qk1-x731.google.com with SMTP id z11so22023835qkj.7 for ; Tue, 19 Jan 2021 06:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=Ts+kpTh5cvoHzerQcB3EpSQjBmIC/7QPoeqJyTJywEY=; b=T/5JedwBOE6KVj9yVCY9Budct0fcNrLyJd8y7wRsDJq5+NQw6msTpSLG8CLiAZRchT e7exoKTdxow58l8L9yXIUxIHYYeczRRSn+fiufbX3w+G8XvZ4ibgw9LXh7Kqr8NOL22J IU+4JTQ2Ror6mpg7rnh97uc+PPz2cBNdIW0kcrcjFDOVRIe+qpOQSHVie2jAimrFTLYD XncYQfSsX46ClZD3PYv9FrEPzAheurR0E+3A/vjLKuvzpkmhuKwh7PDmIsxdHsyJOfcj 9oqebM72CY8KMC3cTGT8MPR4jRZ/izeGlNAbYhTB0UcKly23X5si8Wd3JXAzNnn58+uM gpYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=Ts+kpTh5cvoHzerQcB3EpSQjBmIC/7QPoeqJyTJywEY=; b=gHNsI1oFdmdO0BItMY4GUQQf38b3iiWaKd7N0mskaphSnbCbTxtkmrE6+Kyo7VnscE plW1DOjgnlkoYQwWDXrrTIpNANS0z4EWABGZ+dLEjwYVRw9MtBrP55n5VwuPsssE7VYa FBk8XUbtz3VrDRIAyEnh4WSnhdW54sufgi+TQq2e+q/kXFkm2pqgnfUNan0xMsUaL/LL HAuLGmUxduUuPdpTjDTMElCT+N74oIXIJUmPejyXACfAFiqRiseCog+YcfoidFBzmVR4 za1gIGZDjF0N+0EBHPCKBC541CFQUZdtCmIKtGU+y2STZs1/UX6vg8MgvqMyQMPMdf48 gUWA== X-Gm-Message-State: AOAM533n+ITF8KVwiZhrxf0Ub+zYqn6XZPuu8MCuFh82glabf2DgImst vzPIw0FOVgFo0Pe1/YZJZBw= X-Google-Smtp-Source: ABdhPJwE0VSvFmaOSYgwkYkaCCkr8TDElu8S4XTq2TpT3xIYtQBuwqRGSaMqsnNajIOUTRyB81dcQQ== X-Received: by 2002:a05:620a:1096:: with SMTP id g22mr4832806qkk.7.1611067912746; Tue, 19 Jan 2021 06:51:52 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:2d44:c1cd:58a0:3f? ([2620:10d:c091:480::1:d708]) by smtp.googlemail.com with ESMTPSA id t68sm13120779qkd.35.2021.01.19.06.51.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jan 2021 06:51:51 -0800 (PST) To: GCC Patches , =?utf-8?q?Martin_Li=C5=A1ka?= From: Nathan Sidwell Subject: c++: Remove unused fn Message-ID: <690ce3ac-98c7-d633-1118-aa43256f827a@acm.org> Date: Tue, 19 Jan 2021 09:51:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Martin pointed out this is found with some warning modes. I had two overloads of a function, but only one was needed. Let's keep the constant one. gcc/cp/ * modules.cc (identifier): Merge overloads. diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 1fd0bcfe3eb..e9a5eaeb4b4 100644 --- i/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -276,13 +276,10 @@ static inline cpp_hashnode *cpp_node (tree id) { return CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (id)); } -static inline tree identifier (cpp_hashnode *node) -{ - return HT_IDENT_TO_GCC_IDENT (HT_NODE (node)); -} -static inline const_tree identifier (const cpp_hashnode *node) + +static inline tree identifier (const cpp_hashnode *node) { - return identifier (const_cast (node)); + return HT_IDENT_TO_GCC_IDENT (HT_NODE (const_cast (node))); } /* During duplicate detection we need to tell some comparators that