diff options
author | Hans Wennborg <hans@hanshq.net> | 2016-05-26 19:42:56 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2016-05-26 19:42:56 +0000 |
commit | 0cbd9c038bb8e45179007c0dc0196659bb478c76 (patch) | |
tree | 29b838af00fdcda9392a1ca75ee7d551d95566fc /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 687d95f5fbef7af7e0a5b5b6b0aa0ff3c31de13f (diff) |
Re-commit r270748 "clang-cl: Treat dllimport explicit template instantiation definitions as declarations (PR27810, PR27811)"
Also make explicit instantiation decls not apply to nested classes when
targeting MSVC. That dll attributes are not inherited by inner classes
might be the explanation for MSVC's behaviour here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 243fedbd65..39ea31656a 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -2542,6 +2542,13 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, == TSK_ExplicitSpecialization) continue; + if (Context.getTargetInfo().getCXXABI().isMicrosoft() && + TSK == TSK_ExplicitInstantiationDeclaration) { + // In MSVC mode, explicit instantiation decl of the outer class doesn't + // affect the inner class. + continue; + } + if (CheckSpecializationInstantiationRedecl(PointOfInstantiation, TSK, Record, MSInfo->getTemplateSpecializationKind(), |