https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91146
--- Comment #2 from Grigorii Lipenko <grishalipenko at protonmail dot com> --- I remove gtest.h. #include "small_vector.h" class A { public: virtual void f () = 0; }; class B : public A { public: void f () override { small_vector<int, 20> v; v.insert (v.begin (), 1); } }; int main () { B b; (void)b; return 0; } I get the warning in this case. If comment inheritance then the warning disappears.