summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-12-03 01:57:47 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-12-03 01:57:47 +0000
commit25dbdfa0ac846b13eb2ab5ac1a026b3e5752b04f (patch)
tree3d2a669bebfe11ba8b0d8e38e1612c42b318ffd9 /clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
parent584042981d729e61cb3ebdbe7608ebb1538d59b8 (diff)
downloadbcm5719-llvm-25dbdfa0ac846b13eb2ab5ac1a026b3e5752b04f.tar.gz
bcm5719-llvm-25dbdfa0ac846b13eb2ab5ac1a026b3e5752b04f.zip
Sema: delay the DLL exported member referencing
An explicit template specialization can cause the implicit template specialization of a type which inherits the attributes. In such a case, we would end up with a delayed template specialization for a dll exported type which we would fail to reference. This would trigger an assertion. We now propagate the dll storage attributes through the inheritance chain. Only after having done so do we reference the delayed template specializations. This allows any implicit specializations which inherit dll storage to also be referenced. llvm-svn: 288570
Diffstat (limited to 'clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp')
-rw-r--r--clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp b/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
new file mode 100644
index 00000000000..c2f2a0773e9
--- /dev/null
+++ b/clang/test/CodeGenCXX/windows-implicit-dllexport-template-specialization.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++11 -triple i686-windows -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-MS
+// RUN: %clang_cc1 -std=c++11 -triple i686-windows-itanium -fdeclspec -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-IA
+
+template <typename>
+struct s {};
+
+template <typename T_>
+class t : s<T_> {};
+
+extern template class t<char>;
+template class __declspec(dllexport) t<char>;
+
+// CHECK-MS: dllexport {{.*}} @"\01??4?$t@D@@QAEAAV0@ABV0@@Z"
+// CHECK-MS: dllexport {{.*}} @"\01??4?$s@D@@QAEAAU0@ABU0@@Z"
+
+// CHECK-IA: dllexport {{.*}} @_ZN1tIcEaSERKS0_
+// CHECK-IA: dllexport {{.*}} @_ZN1sIcEaSERKS0_
+
OpenPOWER on IntegriCloud