diff options
author | Shoaib Meenai <smeenai@fb.com> | 2017-04-20 01:11:42 +0000 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2017-04-20 01:11:42 +0000 |
commit | a90474544e47bd0d4452cfe4d9073ce48bacf150 (patch) | |
tree | b63282d0bb870679b25cf717592ba832eb5ceedb /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 2b0d6134c768e36d9c1d3c2a8485e8e245b3b6f4 (diff) | |
download | bcm5719-llvm-a90474544e47bd0d4452cfe4d9073ce48bacf150.tar.gz bcm5719-llvm-a90474544e47bd0d4452cfe4d9073ce48bacf150.zip |
[Sema] Use MSVC inner class behavior on Itanium
Windows Itanium aims to use MSVC export and import semantics. Inner
class members shouldn't be exported on a dllexport explicit
instantiation definition of the outer class, and they shouldn't be
imported on a dllimport explicit instantiation declaration of the outer
class (instead a local copy should be emitted). We were doing the first
but not the second, and this mismatch can lead to link errors. Fix the
behavior and add tests for both.
Differential Revision: https://reviews.llvm.org/D32213
llvm-svn: 300804
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index edd6edfce9d..2d44489023e 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -2605,10 +2605,11 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, == TSK_ExplicitSpecialization) continue; - if (Context.getTargetInfo().getCXXABI().isMicrosoft() && + if ((Context.getTargetInfo().getCXXABI().isMicrosoft() || + Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment()) && TSK == TSK_ExplicitInstantiationDeclaration) { - // In MSVC mode, explicit instantiation decl of the outer class doesn't - // affect the inner class. + // In MSVC and Windows Itanium mode, explicit instantiation decl of the + // outer class doesn't affect the inner class. continue; } |