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.