From patchwork Mon Oct 1 13:15:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 977232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486722-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="T0MFOnZG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42P2qS0J9fz9s4s for ; Mon, 1 Oct 2018 23:16:34 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=s7NbcluBw9wc0iRdpmjNqmUTGdopBG+N7QhBc3FcYWEmi4/yg5 eT4HMvubtyYGsZbmOcDFsNs1OjZhdOLgOgLMO8RrR2tOee5WM0gfie2LQXn29f8e aoAYi3mXwO6h09OSxy8poo5laZJKhuYpDM+/IsUvICsku64LJg7A05U7k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=XckhIA7lxD9ZQKY5W52G1ue1AfA=; b=T0MFOnZG4D84Lc95YwJo 8jbCyO45lgUm2uw0os+Hs9go4q1xHVlj5N2WC2xlk4WQQ15mMrpJU7m8BnPOPP52 29ygKcv70MIEDOWeojIdEUrdwFGU/+KGUTUpNozzAm82W2BhtrHQyRFttyYXjffF sXdMTSuR6CgXo9AcPsW/+EI= Received: (qmail 62284 invoked by alias); 1 Oct 2018 13:16:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 61990 invoked by uid 89); 1 Oct 2018 13:16:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*jason, decl_context, DECL_CONTEXT, DECL_EXTERNAL X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 Oct 2018 13:15:59 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 23BADAFC1; Mon, 1 Oct 2018 13:15:48 +0000 (UTC) Date: Mon, 1 Oct 2018 15:15:48 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: jason@redhat.com Subject: [PATCH][C]/[C++] Remove DECL_FROM_INLINE use Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 This patch removes checks of DECL_FROM_INLINE from the respective -Wshadow code of the C/C++ FE. I noticed those when looking after DECL_ABSTRACT_ORIGIN uses. Those checks may be from times where we did inlining very early? Bootstrapped and tested on x86_64-unknown-linux-gnu with no regression. OK for trunk? Thanks, Richard. 2018-10-01 Richard Biener c/ * c-decl.c (warn_if_shadowing): Do not test DECL_FROM_INLINE. cp/ * name-lookup.c (check_local_shadow): Do not test DECL_FROM_INLINE. Index: gcc/c/c-decl.c =================================================================== --- gcc/c/c-decl.c (revision 264757) +++ gcc/c/c-decl.c (working copy) @@ -2784,9 +2784,7 @@ warn_if_shadowing (tree new_decl) || warn_shadow_local || warn_shadow_compatible_local) /* No shadow warnings for internally generated vars. */ - || DECL_IS_BUILTIN (new_decl) - /* No shadow warnings for vars made for inlining. */ - || DECL_FROM_INLINE (new_decl)) + || DECL_IS_BUILTIN (new_decl)) return; /* Is anything being shadowed? Invisible decls do not count. */ Index: gcc/cp/name-lookup.c =================================================================== --- gcc/cp/name-lookup.c (revision 264757) +++ gcc/cp/name-lookup.c (working copy) @@ -2628,10 +2628,6 @@ check_local_shadow (tree decl) if (TREE_CODE (decl) == PARM_DECL && !DECL_CONTEXT (decl)) return; - /* Inline decls shadow nothing. */ - if (DECL_FROM_INLINE (decl)) - return; - /* External decls are something else. */ if (DECL_EXTERNAL (decl)) return;