if (DECL_DECLARED_INLINE_P (decl))
return true;
- if (DECL_THIS_STATIC (decl)
- && (header_module_p ()
- || (!DECL_LANG_SPECIFIC (decl) || !DECL_MODULE_PURVIEW_P (decl))))
- /* GM static function. */
+ if (header_module_p ())
+ /* We always need to write definitions in header modules,
+ since there's no TU to emit them in otherwise. */
return true;
if (DECL_TEMPLATE_INFO (decl))
else
{
if (!DECL_INITIALIZED_P (decl))
+ /* Not defined. */
return false;
- if (header_module_p ()
- || (!DECL_LANG_SPECIFIC (decl) || !DECL_MODULE_PURVIEW_P (decl)))
- /* GM static variable. */
+ if (header_module_p ())
+ /* We always need to write definitions in header modules,
+ since there's no TU to emit them in otherwise. */
return true;
if (!TREE_CONSTANT (decl))
--- /dev/null
+// PR c++/115020
+// { dg-additional-options "-fmodules-ts -Wno-global-module" }
+// { dg-module-cmi M:a }
+
+module;
+struct Check { static void assertion(); };
+void Check::assertion() {}
+
+module M:a;
+Check c;
--- /dev/null
+// PR c++/115020
+// { dg-additional-options "-fmodules-ts -Wno-global-module" }
+// { dg-module-cmi M }
+
+module;
+struct Check { static void assertion(); };
+
+export module M;
+import :a;
+void foo() { Check::assertion(); }