From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D488385EC0F; Fri, 6 Sep 2024 21:01:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D488385EC0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1725656463; bh=lPr7vQmgp991ylkBaDrc1jSfZkJh6BTdujKwobnMEqk=; h=From:To:Subject:Date:From; b=MlQyMFwNsyBtCJtVrhM6ItSYJMPNTrtGG2rtKGFM3suj9/uOWuCPpr/iyQ2l8LzIi vOEYjIwKI2emehiZUgwco7D2fu88HWFCFSu5bbXostP0u1VYzfzaNFwdU/bp3BkkYE cA5aUO5d2Ms0bzqKbQORkKLNwoVWSqb3L8flkC9g= From: "rs2740 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/116636] New: Deprecation warning/unavailable error when overriding member of virtual base class Date: Fri, 06 Sep 2024 21:01:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rs2740 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D116636 Bug ID: 116636 Summary: Deprecation warning/unavailable error when overriding member of virtual base class Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rs2740 at gmail dot com Target Milestone: --- Repro: struct B { virtual void f() =3D 0; }; struct C : virtual B { [[deprecated("meow")]] void f() override {} }; :6:24: warning: 'virtual void C::f()' is deprecated: meow [-Wdeprecated-declarations] 6 | void f() override {} | ^ :6:10: note: declared here 6 | void f() override {} | ^ Likewise: struct B { virtual void f() =3D 0; }; struct C : virtual B { [[gnu::unavailable("meow")]] void f() override {} }; :6:24: error: 'virtual void C::f()' is unavailable: meow 6 | void f() override {} | ^ :6:10: note: declared here 6 | void f() override {} | ^ Making the base class non-virtual makes the warning/error go away.=