summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2015-05-27 00:06:45 +0000
committerHans Wennborg <hans@hanshq.net>2015-05-27 00:06:45 +0000
commit17f9b4469e71544ef62059c7c7d99ee684cb323b (patch)
treeae70815af62be0a41bd2ddce91f5dc945f8a957c /clang/lib/Sema/SemaTemplate.cpp
parentbc6a90938426330a76ea1ec29d99ca7fcf46f447 (diff)
downloadbcm5719-llvm-17f9b4469e71544ef62059c7c7d99ee684cb323b.tar.gz
bcm5719-llvm-17f9b4469e71544ef62059c7c7d99ee684cb323b.zip
clang-cl: Handle dll attributes in explicit class template specialization definitions (PR23667)
Previously, we wouldn't call checkDLLAttribute() after the class template specialization definition if the class template was already instantiated by an explicit class template specialization declaration. llvm-svn: 238266
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index b5d04cf1a12..37eeee2f886 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -7365,10 +7365,19 @@ Sema::ActOnExplicitInstantiation(Scope *S,
// Fix a TSK_ExplicitInstantiationDeclaration followed by a
// TSK_ExplicitInstantiationDefinition
if (Old_TSK == TSK_ExplicitInstantiationDeclaration &&
- TSK == TSK_ExplicitInstantiationDefinition)
+ TSK == TSK_ExplicitInstantiationDefinition) {
// FIXME: Need to notify the ASTMutationListener that we did this.
Def->setTemplateSpecializationKind(TSK);
+ if (!getDLLAttr(Def) && getDLLAttr(Specialization)) {
+ auto *A = cast<InheritableAttr>(
+ getDLLAttr(Specialization)->clone(getASTContext()));
+ A->setInherited(true);
+ Def->addAttr(A);
+ checkClassLevelDLLAttribute(Def);
+ }
+ }
+
InstantiateClassTemplateSpecializationMembers(TemplateNameLoc, Def, TSK);
}
OpenPOWER on IntegriCloud