https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965
--- Comment #12 from Hedayat Vatankhah <hedayat.fwd at gmail dot com> --- OK, I found the problem. Yes, the fix is included in 9.1.1. However, the fix assumes that the type must be complete when desctructor is called, but unfortunately, this is a wrong assumption. AFAIK, this is a completely valid C++ code, but cannot be compiled successfully: foo.h: ------------------------------- class Bar { public: struct Less { bool operator()(const Bar& lhs, const Bar& rhs) const; bool operator()(const Bar* lhs, const Bar* rhs) const; }; }; class Biz; #include <set> class Foo { public: void do_something(); std::set<const Biz*, Bar::Less> _map; }; ------------------------------- test.cpp: ------------------------------- void tt() { Foo f; f.do_something(); } ------------------------------- foo.cpp: ------------------------------- #include "foo.h" #include "biz.h" Foo::do_something() { // do an insert... }