summaryrefslogtreecommitdiff
path: root/test/SemaCXX/dllexport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/dllexport.cpp')
-rw-r--r--test/SemaCXX/dllexport.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/SemaCXX/dllexport.cpp b/test/SemaCXX/dllexport.cpp
index e41952562c88e..badb9e259597c 100644
--- a/test/SemaCXX/dllexport.cpp
+++ b/test/SemaCXX/dllexport.cpp
@@ -439,21 +439,17 @@ class __declspec(dllexport) DerivedFromExportedTemplate : public ExportedClassTe
// ImportedTemplate is explicitly imported.
class __declspec(dllexport) DerivedFromImportedTemplate : public ImportedClassTemplate<int> {};
-#ifdef MS
-// expected-note@+4{{class template 'ClassTemplate<double>' was instantiated here}}
-// expected-warning@+4{{propagating dll attribute to already instantiated base class template without dll attribute is not supported}}
-// expected-note@+3{{attribute is here}}
-#endif
class DerivedFromTemplateD : public ClassTemplate<double> {};
+// Base class previously implicitly instantiated without attribute; it will get propagated.
class __declspec(dllexport) DerivedFromTemplateD2 : public ClassTemplate<double> {};
-#ifdef MS
-// expected-note@+4{{class template 'ClassTemplate<bool>' was instantiated here}}
-// expected-warning@+4{{propagating dll attribute to already instantiated base class template with different dll attribute is not supported}}
-// expected-note@+3{{attribute is here}}
-#endif
-class __declspec(dllimport) DerivedFromTemplateB : public ClassTemplate<bool> {};
-class __declspec(dllexport) DerivedFromTemplateB2 : public ClassTemplate<bool> {};
+// Base class has explicit instantiation declaration; the attribute will get propagated.
+extern template class ClassTemplate<float>;
+class __declspec(dllexport) DerivedFromTemplateF : public ClassTemplate<float> {};
+
+class __declspec(dllexport) DerivedFromTemplateB : public ClassTemplate<bool> {};
+// The second derived class doesn't change anything, the attribute that was propagated first wins.
+class __declspec(dllimport) DerivedFromTemplateB2 : public ClassTemplate<bool> {};
#ifdef MS
// expected-warning@+3{{propagating dll attribute to explicitly specialized base class template without dll attribute is not supported}}
@@ -479,6 +475,10 @@ struct __declspec(dllexport) DerivedFromExplicitlyExportInstantiatedTemplate : p
// Base class already instantiated with import attribute.
struct __declspec(dllexport) DerivedFromExplicitlyImportInstantiatedTemplate : public ExplicitlyImportInstantiatedTemplate<int> {};
+template <typename T> struct ExplicitInstantiationDeclTemplateBase { void func() {} };
+extern template struct ExplicitInstantiationDeclTemplateBase<int>;
+struct __declspec(dllexport) DerivedFromExplicitInstantiationDeclTemplateBase : public ExplicitInstantiationDeclTemplateBase<int> {};
+
//===----------------------------------------------------------------------===//
// Precedence