@@ -26154,6 +26154,7 @@ instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p)
}
else
{
+ set_instantiating_module (d);
if (variable_template_p (gen_tmpl))
note_variable_template_instantiation (d);
instantiate_body (td, args, d, false);
new file mode 100644
@@ -0,0 +1,21 @@
+// PR 99377 failed to stream locally instantiated member
+// link failure in function `Check(Widget<int> const&)':
+// bug_c.ii:(.text._Z5CheckRK6WidgetIiE[_Z5CheckRK6WidgetIiE]+0x14): undefined reference to `Widget<int>::Second() const'
+// { dg-module-do link }
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+template<typename>
+struct Widget
+{
+ Widget (int) { }
+
+ bool First() const { return true; }
+
+ bool Second () const { return true;}
+};
+
+inline void Frob (const Widget<int>& w) noexcept
+{
+ w.First ();
+}
+
new file mode 100644
@@ -0,0 +1,10 @@
+// { dg-additional-options -fmodules-ts }
+export module Foo;
+// { dg-module-cmi Foo }
+import "pr99377_a.H";
+
+export inline bool Check (const Widget<int>& w)
+{
+ return w.Second ();
+}
+
new file mode 100644
@@ -0,0 +1,8 @@
+// { dg-additional-options -fmodules-ts }
+
+import Foo;
+
+int main ()
+{
+ return Check (0) ? 0 : 1;
+}