From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 44E843852C6D; Wed, 23 Nov 2022 15:45:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44E843852C6D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669218359; bh=OI93cZ190nS5KvfNm5bEX+pdT+lfdCuOw1SVFNYuOvU=; h=From:To:Subject:Date:From; b=tQz2IaNzK1eim1klLY88m4ePPvpaW2UeMEPHRwhU8blfnLDz1hRB025ZrSLMStvYP N6gIKW+1Dm66KzlIGTT/7fNLzONbZyrUanMfLWJ37QYoXG3xJfrjNExN9e9hF/rZ0n V/Q+0SM+NNmO/vXpXCmzh+UklgcoP17OCdG7c/YU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4266] doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: d601708870ad8dc3ef935e440bf03394891d42e2 X-Git-Newrev: 51f28e3aaf8b50554e7d356c8117399e63132323 Message-Id: <20221123154559.44E843852C6D@sourceware.org> Date: Wed, 23 Nov 2022 15:45:59 +0000 (GMT) List-Id: https://gcc.gnu.org/g:51f28e3aaf8b50554e7d356c8117399e63132323 commit r13-4266-g51f28e3aaf8b50554e7d356c8117399e63132323 Author: Jonathan Wakely Date: Wed Nov 23 10:01:06 2022 +0000 doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor The newer -Wdelete-non-virtual-dtor has no false positives and fewer bugs. There is very little reason to use -Wnon-virtual-dtor instead. gcc/ChangeLog: * doc/invoke.texi (C++ Dialect Options): Recommend using -Wdelete-non-virtual-dtor instead of -Wnon-virtual-dtor. Diff: --- gcc/doc/invoke.texi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 330da6eb5d4..4899bd1ea4c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3986,6 +3986,9 @@ destructor itself or in an accessible polymorphic base class, in which case it is possible but unsafe to delete an instance of a derived class through a pointer to the class itself or base class. This warning is automatically enabled if @option{-Weffc++} is specified. +The @option{-Wdelete-non-virtual-dtor} option (enabled by @option{-Wall}) +should be preferred because it warns about the unsafe cases without false +positives. @item -Wregister @r{(C++ and Objective-C++ only)} @opindex Wregister