[PATCH] D26657: [Sema] Respect DLL attributes more faithfully

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 14:06:19 PST 2016


hans added inline comments.


================
Comment at: lib/Sema/SemaTemplate.cpp:7670-7673
+    if ((Old_TSK == TSK_ExplicitInstantiationDeclaration ||
+         Old_TSK == TSK_ImplicitInstantiation) &&
         (TSK == TSK_ExplicitInstantiationDefinition ||
          DLLImportExplicitInstantiationDef)) {
----------------
smeenai wrote:
> rnk wrote:
> > Is this the right logic in the case of `Old_TSK == TSK_Implicit && TSK == TSK_Explicit`? We don't want a behavior change when DLLImport is not involved. A test for that case would be good.
> I'm actually concerned about the `dllexport` case and not the `dllimport` case, after my discussion with @hans. I'm updating this diff to that effect.
I think what Reid is alluding to is regardless of dll attributes, you're adding another OR-clause to this if condition which will cause us to e.g. do `Def->setTemplateSpecializationKind` below, so something is changing in how we handle implicit instantiation followed by explicit instantiation def in general, not just for dllexport which might not be what we want?


https://reviews.llvm.org/D26657





More information about the cfe-commits mailing list