@@ -11816,6 +11816,8 @@ instantiate_class_template_1 (tree type)
input_location = DECL_SOURCE_LOCATION (TYPE_NAME (type)) =
DECL_SOURCE_LOCATION (typedecl);
+ set_instantiating_module (TYPE_NAME (type));
+
TYPE_PACKED (type) = TYPE_PACKED (pattern);
SET_TYPE_ALIGN (type, TYPE_ALIGN (pattern));
TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (pattern);
new file mode 100644
@@ -0,0 +1,20 @@
+// PR 99389 failed to stream class specialization
+// { dg-module-do link }
+// { dg-additional-options "-fmodule-header" }
+// { dg-module-cmi {} }
+template<typename _CharT>
+class basic_string_view
+{
+public:
+ basic_string_view(const _CharT* __str) noexcept
+ {}
+ bool
+ empty() const noexcept
+ { return !_M_len; }
+
+private:
+ unsigned _M_len;
+};
+
+using string_view = basic_string_view<char>;
+
new file mode 100644
@@ -0,0 +1,12 @@
+// { dg-additional-options {-fmodules-ts -fdump-lang-module } }
+export module hello;
+// { dg-module-cmi hello }
+
+import "pr99389_a.H";
+
+export inline bool Check (const string_view& n)
+{
+ return !n.empty ();
+}
+
+// { dg-final { scan-lang-dump {Pending specialization '::basic_string_view<char>' entity:. section:. keyed to '::basic_string_view'} module } }
new file mode 100644
@@ -0,0 +1,7 @@
+// { dg-additional-options -fmodules-ts }
+import hello;
+
+int main ()
+{
+ return Check ("World") ? 0 : 1;
+}