[PATCH] D61118: [MinGW] Fix dllexport of explicit template instantiation

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 00:20:00 PDT 2019


mstorsjo created this revision.
mstorsjo added reviewers: rnk, hans, smeenai.
Herald added a project: clang.

Contrary to MSVC, GCC/MinGW needs to have the dllexport attribute on the template instantiation declaration, not on the definition.

Previously clang never marked explicit template instantiations as dllexport in MinGW mode, regardless of where the attribute was placed. This makes Clang behave like GCC in this regard, and allows using the same attribute form for both MinGW compilers.

This fixes PR40256.


Repository:
  rC Clang

https://reviews.llvm.org/D61118

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaDeclCXX.cpp
  lib/Sema/SemaTemplate.cpp
  test/CodeGenCXX/mingw-template-dllexport.cpp
  test/SemaCXX/dllexport.cpp
  test/SemaCXX/dllimport.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61118.196583.patch
Type: text/x-patch
Size: 8601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190425/25650549/attachment-0001.bin>


More information about the cfe-commits mailing list