From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E9F5B3858D32; Wed, 1 Nov 2023 18:04:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9F5B3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698861880; bh=N1Ghl8+2I1Ai1b3vnDVMP1iCnAK0q4f11Oize7xdZcQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gX1B34emhAcWHeOfyq+E+IIh8fAc339YmHu2NKwREqAcP307fwUkd0w0YblxpRHLb P/mniDNweBZcekASGvsMnaY60LWrRJozz4CT3UMWM+ilGjP05srtNf7ps2YfyM32x3 7gcTacOjBfPExGjN7AcaD2PVw4Wu5Nq3gh7g/xjM= 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:04:39 +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: cc 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 Alexander Goomenuk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emerg.reanimator at gmail = dot com --- Comment #3 from Alexander Goomenuk = --- Let consider the following case: - There is a base class that implement virtual assignment operator with arbitrary input argument (not copy operator). - There is a derived class that inherits the assignment operator from base class. g++ version >=3D 13 produces the warning in this case because implicitly-de= fined copy operator of derived class pretends to hide the user defined assignment operator of base class. The code is totally fine and the assignment operator works as expected.=20 Even worse, the warning is produced by compiler even if no implicitly-defin= ed copy operator is NOT generated by the compiler and the code fails to build = due to the lack of copy operator. So the warning is misleading and incorrect in this case. See https://stackoverflow.com/questions/77378553/woverloaded-virtual-with-defau= lt-shallow-copy-operator for more details.=