[libcxx-commits] [PATCH] D61123: [libc++] Set _LIBCPP_DLL_VIS on _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS in MinGW mode

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 25 12:32:38 PDT 2019


mstorsjo added a comment.

In D61123#1479053 <https://reviews.llvm.org/D61123#1479053>, @ldionne wrote:

> > Contrary to MSVC, MinGW compilers wants the dllexport attribute on the declaration of an explicit template instantiation, not on the definition.
>
> That sounds weird, I would expect an attribute on the explicit instantiation definition to work, since you don't technically need an explicit instantiation declaration to be visible in order to provide an explicit instantiation definition.


You're right; if there's no instantiation declaration, then GCC doesn't warn and uses the attribute from the definition. I'ts only ignored (and warned about) by GCC if there's an earlier declaration.

I'll amend the corresponding clang patch to match this aspect, and land this one.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61123/new/

https://reviews.llvm.org/D61123





More information about the libcxx-commits mailing list