[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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168
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:
https://github.com/boostorg/system/issues/83
It took me a while to figure out why the warning fires: because of the `friend
class error_code` declaration in `error_category`
(https://godbolt.org/z/z6x14P7M4).
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