https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62051
--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> --- yep, this seems to be the usual situation where visibilities does not mix that well with assumptions that program is linked with symbols defined in the headers. I suppose we could make C++ FE to track if a type has methods with visibility default declared (I can't track that from symbol table as they may be unreachable). In such case we may want to consider methods of that type with non-default visibility and no resolution info to be !can_refer_decl_in_current_unit_p Jason, would that make sense to you?