From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-h1p-028590.sys.comcast.net (resqmta-h1p-028590.sys.comcast.net [IPv6:2001:558:fd02:2446::8]) by sourceware.org (Postfix) with ESMTPS id 48874385AC26 for ; Thu, 11 Aug 2022 13:00:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 48874385AC26 Received: from resomta-h1p-028434.sys.comcast.net ([96.102.179.205]) by resqmta-h1p-028590.sys.comcast.net with ESMTP id M73VoG4CFgfn1M7ntoqFpb; Thu, 11 Aug 2022 13:00:49 +0000 Received: from smtpclient.apple ([73.60.223.101]) by resomta-h1p-028434.sys.comcast.net with ESMTPSA id M7nXoailinkSwM7nYocJco; Thu, 11 Aug 2022 13:00:29 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeggedgiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhhtddvnecuhfhrohhmpefrrghulhcumfhonhhinhhguceophgruhhlkhhonhhinhhgsegtohhmtggrshhtrdhnvghtqeenucggtffrrghtthgvrhhnpedutdfffffggfefffdtledufeetgeethfduieffjeetiedvtedvhfefgfejfeehgeenucffohhmrghinheptghpphhrvghfvghrvghntggvrdgtohhmnecukfhppeejfedriedtrddvvdefrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghlohepshhmthhptghlihgvnhhtrdgrphhplhgvpdhinhgvthepjeefrdeitddrvddvfedruddtuddpmhgrihhlfhhrohhmpehprghulhhkohhnihhnghestghomhgtrghsthdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopehpihhnshhkihgrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepghgttgesghgttgdrghhnuhdrohhrgh X-Xfinity-VMeta: sc=-100.00;st=legit Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Possible C++ method signature warning feature? From: Paul Koning In-Reply-To: Date: Thu, 11 Aug 2022 09:00:27 -0400 Cc: GCC Development Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Andrew Pinski X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Status: No, score=-2.6 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 13:01:00 -0000 > On Aug 10, 2022, at 9:25 PM, Andrew Pinski wrote: >=20 > On Wed, Aug 10, 2022 at 6:20 PM Paul Koning via Gcc = wrote: >>=20 >> There's a C++ problem I keep running into, in a very large body of = software with lots of subclassing. >>=20 >> 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. >>=20 >> 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. >>=20 >> 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". >=20 > C++11's overload keyword sounds exactly what you want. > https://en.cppreference.com/w/cpp/language/override Perfect! Thanks much. paul