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

2022-06-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 --- Comment #7 from Jonathan Wakely --- Like I said, this warning should never be used :-)

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

2022-06-06 Thread pdimov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 --- Comment #6 from Peter Dimov --- Yes, I suppose you're right. The warning warns that Derived _can be_ deleted via Base*, and that's correct - if not very useful in practice in this specific case. In fact the private destructor case is even l

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

2022-06-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 --- Comment #5 from Jonathan Wakely --- But isn't the whole point of the warning to flag that "it is possible but unsafe to delete an instance of a derived class through a pointer to the class itself or base class." If it isn't intended to be de

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

2022-06-06 Thread pdimov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 --- Comment #4 from Peter Dimov --- Warning on a private destructor + a friend declaration makes sense, because a private destructor implies that the type is not intended to be derived from. But warning on a protected destructor + a friend does

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

2022-06-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 Jonathan Wakely changed: What|Removed |Added Blocks||81930 See Also|

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

2022-06-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 --- Comment #2 from Jonathan Wakely --- The -Wnon-virtual-dtor warning is just dumb, that's why I added Clang's -Wdelete-non-virtual-dtor which should be used instead.

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

2022-06-02 Thread pdimov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102168 Peter Dimov changed: What|Removed |Added CC||pdimov at gmail dot com --- Comment #1 fr