https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71484
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Kyle J Strand from comment #0) > A class whose only user-declared methods are `private`, but which *does* > have an implicit public constructor, can trigger `-Wctor-dtor-privacy`. > > See http://stackoverflow.com/q/33157248/1858225 for discussion and sample > code. > > The offending code is copied here for convenience: > > struct foo > { > private: > static int test(void) { return 3; }; > }; That's by design, and is the documented behaviour of the warning. Nothing can ever call that static function.