[PATCH] D20422: [MSVC2015] dllexport for defaulted special class members

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Fri May 20 10:01:02 PDT 2016

rnk added inline comments.

Comment at: lib/Sema/SemaDeclCXX.cpp:13111
@@ -13090,3 +13110,3 @@
       llvm_unreachable("Invalid special member.");
   } else {
DmitryPolukhin wrote:
> rnk wrote:
> > Can we add `if (InClassDef) ActOnFinishInlineFunctionDef(MD);` here instead? If the decl doesn't have dllexport, we will just defer it until its referenced, which seems OK.
> We can move this check here but condition has to be more complicated because MSVC2015 doesn't export trivial defaulted c-tors even if they were explicitly declared dllexport, see my check on line 4822.
Maybe we should handle that case by silently dropping dllexport on trivial defaulted ctors and dtors. Basically I'm trying to keep our dllexport policy decisions local to the dll attribute checking code. We should either consistently call ActOnFinishInlineFunctionDef for special members that were defaulted in the class body, or not do it at all.


More information about the cfe-commits mailing list