]> granicus.if.org Git - clang/commit
[clang-cl] Inherit dllexport to static locals also in template instantiations (PR39496)
authorHans Wennborg <hans@hanshq.net>
Wed, 31 Oct 2018 08:38:48 +0000 (08:38 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 31 Oct 2018 08:38:48 +0000 (08:38 +0000)
commitf9567535a365e87748140b41fa9b0f9befbf5122
tree4f8da7f537b5fbe0c619e5a4a625e3221b1a4940
parent94f13e37e55a5f155cdbe4dbc7bb2cb3a5b43860
[clang-cl] Inherit dllexport to static locals also in template instantiations (PR39496)

In the course of D51340, @takuto.ikuta discovered that Clang fails to put
dllexport/import attributes on static locals during template instantiation.

For regular functions, this happens in Sema::FinalizeDeclaration(), however for
template instantiations we need to do something in or around
TemplateDeclInstantiator::VisitVarDecl(). This patch does that, and extracts
the code to a utility function.

Differential Revision: https://reviews.llvm.org/D53870

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345699 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/CodeGenCXX/dllexport.cpp
test/CodeGenCXX/dllimport.cpp