]> granicus.if.org Git - clang/commit
[Sema] Restrict explicit instantation definition dllexport
authorShoaib Meenai <smeenai@fb.com>
Fri, 13 Jan 2017 01:28:34 +0000 (01:28 +0000)
committerShoaib Meenai <smeenai@fb.com>
Fri, 13 Jan 2017 01:28:34 +0000 (01:28 +0000)
commitad2389cf904e0146e42fcb41f3f4961049ae31e4
treeeff86d05c8ce6586734d74dcb959d58970935ba4
parent531b20818e3a554da19fa5a43800d81a93771d59
[Sema] Restrict explicit instantation definition dllexport

In the case where the template class itself is already `dllexport`, the
implicit instantiation will have already emitted all members. When we
check the explicit instantiation definition, the `Specialization` will
have inherited the `dllexport` attribute, so we'll attempt to emit all
members for a second time, which causes an assertion failure. Restrict
the exporting to when the `dllexport` attribute is newly introduced by
the explicit instantiation definition.

Fixes PR31608.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291877 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplate.cpp
test/CodeGenCXX/dllexport.cpp