[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 9 10:33:57 PST 2020


hans added a comment.

Please take a look.



================
Comment at: clang/lib/Sema/SemaDecl.cpp:13996
   }
 
+  if (auto *Ctor = dyn_cast<CXXConstructorDecl>(FD)) {
----------------
I was searching for the right place to do this, looking mostly in the sema template code, but ended up here as an explicit specialization really works out a lot like a function definition.


================
Comment at: clang/test/CodeGenCXX/dllexport-ctor-closure.cpp:53
 
+template <typename T> struct __declspec(dllexport) ExportedTemplateWithClosure {
+  ExportedTemplateWithClosure(int x = sizeof(T)) {}
----------------
This should also work when dllexport is on the member function rather than the class, but it turns out we currently don't export the function in that case; that's a bug I want to handle separately.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91089



More information about the cfe-commits mailing list