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

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 25 05:52:42 PDT 2018


hans 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);
+
----------------
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?


https://reviews.llvm.org/D48426





More information about the cfe-commits mailing list