From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-a1p-077437.sys.comcast.net (resqmta-a1p-077437.sys.comcast.net [IPv6:2001:558:fd01:2bb4::8]) by sourceware.org (Postfix) with ESMTPS id 0EBA43857359 for ; Thu, 11 Aug 2022 01:18:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0EBA43857359 Received: from resomta-a1p-077049.sys.comcast.net ([96.103.145.227]) by resqmta-a1p-077437.sys.comcast.net with ESMTP id LvxqoavD5DrnaLwqfokG4u; Thu, 11 Aug 2022 01:18:57 +0000 Received: from smtpclient.apple ([IPv6:2601:191:200:f59:bd7c:eb90:d00f:288a]) by resomta-a1p-077049.sys.comcast.net with ESMTPSA id Lwqeoh9eHw04CLwqfoXS28; Thu, 11 Aug 2022 01:18:57 +0000 X-Xfinity-VMeta: sc=0.00;st=legit From: Paul Koning Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Possible C++ method signature warning feature? Message-Id: Date: Wed, 10 Aug 2022 21:18:56 -0400 To: GCC Development X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, JMQ_SPF_NEUTRAL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2022 01:19:00 -0000 There's a C++ problem I keep running into, in a very large body of = software with lots of subclassing. There's a base class that defines a set of interface methods, not all = pure virtual (some define the default behavior). A number of subclasses = override some but not all of these. Now I find myself changing the argument list of some of these methods, = so I have to change the base class definitions and also track down all = the subclass redefinitions. If I miss one of the latter, that subclass = method is no longer called (it now just looks like an unrelated method = with a different argument list that isn't used anywhere). Finding these = things can be hard and time consuming. It would be helpful to have some way to mark a method as "this is = supposed to be an override of a base class method", in other words "warn = me if this method doesn't override some method in a base class". Does that sound like a possible thing to do, perhaps with some = __attribute__ magic? Would it be interesting? paul