[Bug c++/102168] -Wnon-virtual-dtor shouldn't fire for protected dtor in a class with a friend declaration

pdimov at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 2 14:19:58 GMT 2022


Peter Dimov <pdimov at gmail dot com> changed:

           What    |Removed                     |Added
                 CC|                            |pdimov at gmail dot com

--- Comment #1 from Peter Dimov <pdimov at gmail dot com> ---
An issue against Boost.System has just been filed as a result of this warning:

It took me a while to figure out why the warning fires: because of the `friend
class error_code` declaration in `error_category`

Please reconsider issuing the warning when the destructor is protected and a
friend declaration exists. A protected destructor is a clear indication that
the type is intended as a base class.

More information about the Gcc-bugs mailing list