inline bool module_partition_p ()
{ return module_kind & MK_PARTITION; }
inline bool module_has_cmi_p ()
-{ return module_kind & (MK_INTERFACE | MK_PARTITION); }
+{ return module_kind & (MK_INTERFACE | MK_PARTITION | MK_HEADER); }
inline bool module_purview_p ()
{ return module_kind & MK_PURVIEW; }
inline bool named_module_attach_p ()
{ return named_module_p () && module_attach_p (); }
-/* We don't know if this TU will have a CMI while parsing the GMF,
- so tentatively assume that it might, for the purpose of determining
- whether no-linkage decls could be used by an importer. */
+/* Like module_has_cmi_p, but tentatively assumes that this TU may have a
+ CMI if we haven't seen the module-declaration yet. */
inline bool module_maybe_has_cmi_p ()
{ return module_has_cmi_p () || (named_module_p () && !module_purview_p ()); }
gcc_checking_assert (!DECL_LANG_SPECIFIC (decl)
|| !DECL_MODULE_IMPORT_P (decl));
- if (module_p ())
+ if (module_maybe_has_cmi_p ())
{
/* We need to track all declarations within a module, not just those
in the module purview, because we don't necessarily know yet if
void
set_defining_module_for_partial_spec (tree decl)
{
- if (module_p ()
+ if (module_maybe_has_cmi_p ()
&& DECL_IMPLICIT_TYPEDEF_P (decl)
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
vec_safe_push (partial_specializations, decl);
if (level->kind == sk_namespace
&& TREE_PUBLIC (level->this_entity)
- && module_p ())
+ && module_maybe_has_cmi_p ())
maybe_record_mergeable_decl (slot, name, decl);
}
}