From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E1253858039; Fri, 4 Mar 2022 08:54:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E1253858039 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/104627] [12 Regression] New failure in deprecated.c Date: Fri, 04 Mar 2022 08:54:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic, testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2022 08:54:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104627 --- Comment #8 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:49bc9c6c1ef9441c3db586882e1985da3be9cfa1 commit r12-7473-g49bc9c6c1ef9441c3db586882e1985da3be9cfa1 Author: Jakub Jelinek Date: Fri Mar 4 09:53:36 2022 +0100 tree: Fix up warn_deprecated_use [PR104627] The r12-7287-g1b71bc7c8b18bd1b change improved the -Wdeprecated warning for C++, but regressed it for C, in particular in gcc.dg/deprecated.c testcase we now report a type that actually isn't deprecated as deprecated instead of the one that is deprecated. The following change tries to find the middle ground between what we used to do before and what r12-7287 change does. If TYPE_STUB_DECL (node) is non-NULL (that is what happens with those C tests), then it will do what it used to do before (just smarter, there is no need to lookup_attribute when it is called again a few lines below this), if it is NULL, it will try TYPE_STUB_DECL (TYPE_MAIN_VARIANT (node)) - what the deprecated-16.C test needs. 2022-03-04 Jakub Jelinek PR c/104627 * tree.cc (warn_deprecated_use): For types prefer to use node and only use TYPE_MAIN_VARIANT (node) if TYPE_STUB_DECL (node) = is NULL.=