From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8ABB3858D28; Wed, 1 Nov 2023 18:56:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8ABB3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698864974; bh=Qswvk1QYlUAuqk1cxov/s+gb0ecDTBa/q0r+IQyT4FA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CsO24Z6MzOsa0HriG1UjtTmJ89jCR/FrWoPGPFnqHlfkGK3460szUYNK/QgRl4koo m7dDgdEdCzqJMYyS/kr1KpMIQhJnvUixWCf2QY5bagxtHCNouzHgwsxN2DG1XNyIT7 iWhSFoAbbBcOH+EUDatJKpuiEWIn3dZlHOAY0wkc= From: "emerg.reanimator at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109740] -Woverloaded-virtual is too aggressive Date: Wed, 01 Nov 2023 18:56:14 +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: 13.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: emerg.reanimator 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109740 --- Comment #4 from Alexander Goomenuk = --- https://en.cppreference.com/w/cpp/language/using_declaration # In class definition ... If the derived class already has a member with the same name, parameter lis= t, and qualifications, *the derived class member hides or overrides (doesn't conflict with) the member that is introduced from the base class*. ---- https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/C_002b_002b-Dialect-Options.h= tml#index-Woverloaded-virtual In cases where the different signatures are not an accident, the simplest solution is to add a *using-declaration to the derived class to un-hide the base function*, e.g. add using A::f; to B.=20 ---- These two statements contradict each other, isn't it?=