在 2023/4/3 16:55, Vittorio Romeo 写道:
Hello everyone, Hope you are doing well.I've encountered and reported a bug related to explicit template instantiations and dllexport using the latest version of GCC on MinGW/MSYS2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109380
I don't think it's a bug. There are two issues in your testcase, one is that extern template struct __declspec(dllexport) S<int>; is a declaration, and nothing can be exported from a declaration (you export the definition instead).The other is that `g()` is an implicit inline function. An inline function can only be exported when it is emitted as a non-inline copy, for example, when optimization is not enabled, or when its address is taken, or when it is virtual and the class has a non-pure non-inline virtual function (a.k.a. the key function) which instantiates its vtable.
-- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
