[PATCH] D48426: [clang-cl] Don't emit dllexport inline functions etc. from pch files (PR37801)

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 25 05:59:39 PDT 2018


thakis added inline comments.


================
Comment at: test/CodeGen/pch-dllexport.cpp:55
+template <typename T> void __declspec(dllexport) explicitInstantiationDefAfterDecl(T) {}
+extern template void explicitInstantiationDefAfterDecl<int>(int);
+
----------------
hans wrote:
> thakis wrote:
> > This has two interesting cases:
> > 
> > 1. An explicit instantiation declaration.
> > 2. An explicit instantiation definition.
> > 
> > You have a test for 2, but not for 1, as far as I can tell (?). For 1, the inline function from the pch-obj should be used (which probably already works; if not a FIXME is enough).
> It's really testing the "explicit instantiation def after explicit instantiation decl" case.
> 
> With just an explicit instantiation decl (1), there's not much to test, since that's like a promise that someone else is going to instantiate the template. Nothing needs to be emitted for that.
> 
> Maybe I'm not understanding your question?
> Nothing needs to be emitted for that.

Right, I meant including a test that we really don't emit anything for that. But feel free to omit it if you don't think it adds much. I suggested it because we end up with TSK_ExplicitInstantiationDeclaration in that case, and you're checking the TSK in this change, and you have coverage for the other kinds.


https://reviews.llvm.org/D48426





More information about the cfe-commits mailing list