[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
Fri Jun 22 07:31:54 PDT 2018


hans added a comment.

I hit a snag while building some more Chromium targets. For class templates with explicit instantiation decls in the PCH file and explicit instantiation definitions in a .cc file, the function definition will be marked as coming from the PCH, even though it wasn't defined there. For example:

  #ifndef IN_HEADER
  #define IN_HEADER
  
  template <typename T> struct Template { Template() {} };
  extern template class Template<int>;
  
  #else
  
  template class __declspec(dllexport) Template<int>;
  
  #endif

This isn't a problem for regular functions where we build a decl chain: the first declaration may come from a PCH, but the definition would be a separate Decl object which does not.

I'm trying to figure out how to handle this.


https://reviews.llvm.org/D48426





More information about the cfe-commits mailing list