https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81855
--- Comment #2 from Xingcan Lan <lanxingcan at gmail dot com> --- Checked diassembly code and found that __declspec(dllexport) never applied to explicitly instantiated `Template<void>`. If I change the code from `extern template struct __declspec(dllexport) Template<void>;` to `extern template __declspec(dllexport) struct Template<void>;`, the compiler will warns me that dllexport attribute will be ignored. My conclusion: 1) I didn't properly applied dllexport attribute, which was syntactical incorrect but silently accepted by the compiler. 2) I suspect the behavior of linker is, if no symbol were marked as dll-exported, then all symbol will be exported. Anyway, it's expected that explicit instantiated template could be exported normally as other symbol. Even if it's not supported, compiler should at least warns about the syntax error or ignore those explicit template instantiation which were marked with __declspec(dllimport) and/or __declspec(dllexport) and emit code for each compile unit that implicitly instantiated the template to avoid link error.