unit. */
import_p = false;
+ /* FIXME: Since https://github.com/itanium-cxx-abi/cxx-abi/pull/171,
+ the ABI specifies that classes attached to named modules should
+ have their vtables uniquely emitted in the object for the module
+ unit in which it is defined. And similarly for RTTI structures. */
if (VAR_P (decl) && DECL_VTABLE_OR_VTT_P (decl))
{
class_type = DECL_CONTEXT (decl);
WB (t->decl_common.lang_flag_2);
WB (t->decl_common.lang_flag_3);
WB (t->decl_common.lang_flag_4);
- WB (t->decl_common.lang_flag_5);
+
+ {
+ /* This is DECL_INTERFACE_KNOWN: We should redetermine whether
+ we need to import or export any vtables or typeinfo objects
+ on stream-in. */
+ bool interface_known = t->decl_common.lang_flag_5;
+ if (VAR_P (t) && (DECL_VTABLE_OR_VTT_P (t) || DECL_TINFO_P (t)))
+ interface_known = false;
+ WB (interface_known);
+ }
+
WB (t->decl_common.lang_flag_6);
WB (t->decl_common.lang_flag_7);
WB (t->decl_common.lang_flag_8);
return !(Visit (&me) == 1);
}
-// We do not emit Visitor vtable
-// but we do emit rtti here
-// { dg-final { scan-assembler-not {_ZTVW3foo7Visitor:} } }
+// Again, we emit Visitor vtable and rtti here
+// { dg-final { scan-assembler {_ZTVW3foo7Visitor:} } }
// { dg-final { scan-assembler {_ZTIW3foo7Visitor:} } }
// { dg-final { scan-assembler {_ZTSW3foo7Visitor:} } }
--- /dev/null
+// PR c++/114229
+// { dg-additional-options "-fmodules-ts -Wno-global-module" }
+// { dg-module-cmi modA }
+
+module;
+template<class> struct basic_streambuf { virtual void overflow() { } };
+extern template struct basic_streambuf<long>;
+export module modA;
+export basic_streambuf<long> *p;
--- /dev/null
+// PR c++/114229
+// { dg-additional-options "-fmodules-ts -fno-module-lazy" }
+// { dg-module-cmi modB }
+
+export module modB;
+import modA;
--- /dev/null
+// PR c++/114229
+template<class> struct basic_streambuf { virtual void overflow() { } };
+template struct basic_streambuf<long>;
--- /dev/null
+// PR c++/114229
+// { dg-module-do link }
+// { dg-additional-options "-fmodules-ts -fno-module-lazy" }
+
+import modA;
+import modB;
+int main() { }