diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-06-09 00:39:05 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-06-09 00:39:05 +0000 |
commit | c0875507becfe14ad83acd50cceb66d1de641d1c (patch) | |
tree | 7fb32b1eb63cb522c22475878eeb913243959a7f /clang/lib/Sema/SemaTemplate.cpp | |
parent | bb1983cf3a1b7ff57d6cfdc05a04128bfa3721d1 (diff) | |
download | bcm5719-llvm-c0875507becfe14ad83acd50cceb66d1de641d1c.tar.gz bcm5719-llvm-c0875507becfe14ad83acd50cceb66d1de641d1c.zip |
MinGW: don't allow adding DLL attribute if template already has explicit instantiation declaration
This is a follow-up to r238266 which failed to take MinGW into account.
llvm-svn: 239374
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 37eeee2f886..4fb7cb8f1dd 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -7369,7 +7369,11 @@ Sema::ActOnExplicitInstantiation(Scope *S, // FIXME: Need to notify the ASTMutationListener that we did this. Def->setTemplateSpecializationKind(TSK); - if (!getDLLAttr(Def) && getDLLAttr(Specialization)) { + if (!getDLLAttr(Def) && getDLLAttr(Specialization) && + Context.getTargetInfo().getCXXABI().isMicrosoft()) { + // In the MS ABI, an explicit instantiation definition can add a dll + // attribute to a template with a previous instantiation declaration. + // MinGW doesn't allow this. auto *A = cast<InheritableAttr>( getDLLAttr(Specialization)->clone(getASTContext())); A->setInherited(true); |