https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79078
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- This warns about the use of D within its own class body: struct [[deprecated("D is bad mmmkay")]] D { void f(const D&); }; d.cc:2:18: warning: āDā is deprecated [-Wdeprecated-declarations] void f(const D&); ^ Surely member functions of a deprecated class should be able to refer to the class, otherwise you can't even implement the API without warnings. And even if users don't use the class, simply including the header will warn, because the class refers to itself.