diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index ce0ba69641b27e5c1677379d4a29db61656ad605..7c42aea05eec5edd3f15bd32924b31b725f946a8 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -11790,10 +11790,9 @@ has_definition (tree decl)
       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))
@@ -11826,11 +11825,12 @@ has_definition (tree 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))
diff --git a/gcc/testsuite/g++.dg/modules/pr115020_a.C b/gcc/testsuite/g++.dg/modules/pr115020_a.C
new file mode 100644
index 0000000000000000000000000000000000000000..8c190f13b1e50692015eff1fe1f007334268c47c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr115020_a.C
@@ -0,0 +1,10 @@
+// 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;
diff --git a/gcc/testsuite/g++.dg/modules/pr115020_b.C b/gcc/testsuite/g++.dg/modules/pr115020_b.C
new file mode 100644
index 0000000000000000000000000000000000000000..e299454ed546bb93ad2423d9f78252fdc9cad92f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr115020_b.C
@@ -0,0 +1,10 @@
+// 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(); }